Index
All Classes|All Packages
A
- AbstractPuzzleGenerator<P> - Class in zebra4j
- AbstractPuzzleGenerator(Randomness, PuzzleSolution, Set<Fact.Type>) - Constructor for class zebra4j.AbstractPuzzleGenerator
- add(E) - Method in class zebra4j.util.CollectionChain
- add(Attribute...) - Method in class zebra4j.PuzzleSolutionBuilder
-
Adds a new person with the given attributes to the solution
- add(SolutionPerson) - Method in class zebra4j.PuzzleSolutionBuilder
-
Adds a new person
- addAll(Collection<? extends E>) - Method in class zebra4j.util.CollectionChain
- addFact(Fact) - Method in class zebra4j.PuzzleBuilder
-
Adds a fact to the puzzle under construction.
- addSet(String, String...) - Method in class zebra4j.PuzzleBuilder
-
Creates a new
BasicAttributeType
with the given parameters and adds it to the puzzle under construction. - addSet(Attribute...) - Method in class zebra4j.PuzzleBuilder
-
Includes an attribute set of some type in the puzzle
- addToModel(ZebraModel, Set<Attribute>, int) - Method in class zebra4j.AllDifferentType
- addToModel(ZebraModel, Set<Attribute>, int) - Method in interface zebra4j.AttributeType
-
Adds rules related to the subset of attributes of this type used in a puzzle to the model describing the puzzle
- addWithHouse(Attribute...) - Method in class zebra4j.PuzzleSolutionBuilder
-
Adds a new person in the next house
- AllDifferentType - Class in zebra4j
-
A type of attribute that is guaranteed to be different for all people
- AllDifferentType() - Constructor for class zebra4j.AllDifferentType
- answer(PuzzleSolution) - Method in class zebra4j.Question
-
Answers this question about the given solution, if applicable
- appliesTo(BasicPuzzle) - Method in class zebra4j.fact.CommutativeFact
- appliesTo(BasicPuzzle) - Method in interface zebra4j.fact.Fact
- appliesTo(BasicPuzzle) - Method in class zebra4j.fact.NearbyHouse
- appliesTo(BasicPuzzle) - Method in class zebra4j.Question
- appliesTo(PuzzleSolution) - Method in class zebra4j.fact.BothTrue
- appliesTo(PuzzleSolution) - Method in class zebra4j.fact.Different
- appliesTo(PuzzleSolution) - Method in interface zebra4j.fact.Fact
- appliesTo(PuzzleSolution) - Method in class zebra4j.fact.NearbyHouse
- appliesTo(PuzzleSolution) - Method in class zebra4j.Question
- asList() - Method in class zebra4j.SolutionPerson
- AT_HOUSE - Static variable in interface zebra4j.Attributes
- AtHouse - Class in zebra4j
-
The house that the person lives in.
- AtHouse(int) - Constructor for class zebra4j.AtHouse
- Attribute - Interface in zebra4j
-
A known attribute for a person like a specific "name", "pet" or if the person is criminal
- Attributes - Interface in zebra4j
-
A library of people attributes, demonstrating different ways to define them.
- AttributeType - Interface in zebra4j
-
A type attribute for a person like a "name", "pet" or if the person is a criminal
- attributeTypes() - Method in class zebra4j.fact.CommutativeFact
- attributeTypes() - Method in interface zebra4j.fact.Fact
-
Collect the types of the attributes referenced by the fact
- attributeTypes() - Method in class zebra4j.fact.NearbyHouse
- attributeTypes() - Method in class zebra4j.SolutionPerson
B
- BasicAttributeType - Class in zebra4j
-
Defines an attribute type using a set of labels.
- BasicAttributeType(Set<String>, String, String) - Constructor for class zebra4j.BasicAttributeType
-
Create a new basic type of attribute with enumerated set of attributes
- BasicPuzzle - Class in zebra4j
-
A puzzle that asks all attributes in
BasicPuzzle.getAttributeSets()
to be assigned to people, satisfying rules defined by the attribute sets used in the puzzle (e.g. - BasicPuzzle(Map<AttributeType, Set<Attribute>>, Collection<Fact>) - Constructor for class zebra4j.BasicPuzzle
- BLUE - Enum constant in enum zebra4j.Clothes
- BothTrue - Class in zebra4j.fact
- BothTrue(Attribute, Attribute) - Constructor for class zebra4j.fact.BothTrue
- build() - Method in class zebra4j.PuzzleBuilder
- build() - Method in class zebra4j.PuzzleSolutionBuilder
C
- canEqual(Object) - Method in class zebra4j.BasicAttributeType
- canEqual(Object) - Method in class zebra4j.PuzzleSolution
- canEqual(Object) - Method in class zebra4j.SolutionPerson
- clear() - Method in class zebra4j.util.CollectionChain
- Cli - Class in zebra4j
-
CLI for zebra4j
- Cli() - Constructor for class zebra4j.Cli
- Clothes - Enum in zebra4j
-
The color of a persons clothes.
- CLOTHES - Static variable in interface zebra4j.Attributes
-
Clothes attribute.
- CollectionChain<E> - Class in zebra4j.util
-
Immutable ordered union view on two collections
- CollectionChain(Collection<E>, Collection<E>) - Constructor for class zebra4j.util.CollectionChain
- CommutativeFact - Class in zebra4j.fact
-
A fact about a commutative relationship between people identified by two attributes, called "left" and "right"
- CommutativeFact() - Constructor for class zebra4j.fact.CommutativeFact
- CommutativeFact.Source - Interface in zebra4j.fact
- contains(Object) - Method in class zebra4j.util.CollectionChain
- contains(Attribute) - Method in class zebra4j.BasicPuzzle
- containsAll(Collection<?>) - Method in class zebra4j.util.CollectionChain
- countSolutions(P) - Method in class zebra4j.AbstractPuzzleGenerator
- countSolutions(BasicPuzzle) - Method in class zebra4j.PuzzleGenerator
- countSolutions(QuestionPuzzle) - Method in class zebra4j.QuestionPuzzleGenerator
- create(Attribute, Attribute) - Method in interface zebra4j.fact.CommutativeFact.Source
- createUniqueVariable(Attribute, int) - Method in class zebra4j.ZebraModel
-
Creates a variable for an attribute that can be held by only one person in the solution
- Criminal - Enum in zebra4j
- CRIMINAL - Static variable in interface zebra4j.Attributes
D
- DEFAULT_FACT_TYPES - Static variable in class zebra4j.AbstractPuzzleGenerator
- DEFAULT_TYPES - Static variable in interface zebra4j.Attributes
-
The set of attributes used by the demos
- describe(Locale) - Method in class zebra4j.fact.CommutativeFact
- describe(Locale) - Method in interface zebra4j.fact.Fact
-
Describes the facts in natural language in the given locale
- describe(Locale) - Method in class zebra4j.fact.NearbyHouse
- describe(Locale) - Method in class zebra4j.PuzzleSolution
-
Describe the solution in natural language
- describe(Locale) - Method in class zebra4j.Question
-
Converts the question to a natural language sentence
- describe(Locale) - Method in class zebra4j.SolutionPerson
-
Describe the person-in-solution in natural language
- describeConstraints(Locale) - Method in class zebra4j.BasicPuzzle
-
Describe in natural language the constraints that the solution must satisfy.
- describeConstraints(Locale) - Method in class zebra4j.QuestionPuzzle
- describeSet(Collection<Attribute>, Locale) - Method in class zebra4j.AllDifferentType
- describeSet(Collection<Attribute>, Locale) - Method in interface zebra4j.AttributeType
-
Describe the given set of attributes in the form of sentence, in the given locale, describing a rule for solving a puzzle.
- description(Locale) - Method in class zebra4j.AtHouse
- description(Locale) - Method in interface zebra4j.Attribute
-
As in the sentence "Ivan is {description}"
- description(Locale) - Method in enum zebra4j.Clothes
- description(Locale) - Method in enum zebra4j.Criminal
- description(Locale) - Method in enum zebra4j.PersonName
- Different - Class in zebra4j.fact
- Different(Attribute, Attribute) - Constructor for class zebra4j.fact.Different
E
- ELENA - Enum constant in enum zebra4j.PersonName
- equals(Object) - Method in class zebra4j.AtHouse
- equals(Object) - Method in class zebra4j.BasicAttributeType
- equals(Object) - Method in class zebra4j.BasicPuzzle
- equals(Object) - Method in class zebra4j.fact.CommutativeFact
- equals(Object) - Method in class zebra4j.fact.NearbyHouse
- equals(Object) - Method in class zebra4j.PuzzleSolution
- equals(Object) - Method in class zebra4j.Question
- equals(Object) - Method in class zebra4j.QuestionPuzzle
- equals(Object) - Method in class zebra4j.SolutionPerson
F
- Fact - Interface in zebra4j.fact
-
A fact given as a clue to the players
- Fact.Type - Interface in zebra4j.fact
-
A type of facts
- findAttribute(AttributeType) - Method in class zebra4j.SolutionPerson
-
Finds one attributes of the person given type
- findByLabel(String) - Method in class zebra4j.BasicAttributeType
-
Finds the attribute with the given label if any, case sensitive
- findPerson(Attribute) - Method in class zebra4j.PuzzleSolution
-
Find a person based on an attribute
- fromJson(String) - Static method in class zebra4j.BasicAttributeType
G
- generate() - Method in class zebra4j.AbstractPuzzleGenerator
-
Tip: one can generate several puzzles quickly with a parallel stream:
- generate() - Method in class zebra4j.SolutionGenerator
-
Generates a new puzzle.
- generate(Map<AttributeType, Set<Attribute>>, Randomness) - Static method in class zebra4j.Question
-
Generates a random question using the given sets of attributes
- generate(PuzzleSolution) - Method in interface zebra4j.fact.Fact.Type
-
Generates all facts of that type that apply to the given solution
- generate(PuzzleSolution) - Static method in class zebra4j.Question
-
Generates a random question about the people in the given solution
- GEORGE - Enum constant in enum zebra4j.PersonName
- get() - Method in class zebra4j.AbstractPuzzleGenerator
- get() - Method in class zebra4j.SolutionGenerator
- get() - Method in class zebra4j.util.LazyInstance
-
get() can't throw because
LazyInstance.initialize()
doesn't throw. - getAbout() - Method in class zebra4j.Question
- getAttributes(int) - Method in interface zebra4j.AttributeType
-
Return some attributes of this type.
- getAttributes(int) - Method in class zebra4j.BasicAttributeType
- getAttributeSets() - Method in class zebra4j.BasicPuzzle
-
The attribute types and the sub-sets of their values used in the puzzle.
- getAttributeSets() - Method in class zebra4j.PuzzleSolution
-
The sets of attributes referenced in the solution, grouped by type.
- getBasicPuzzle() - Method in class zebra4j.QuestionPuzzle
-
The basic puzzle that defines the constraints to the people and their attributes that question is about.
- getChocoModel() - Method in class zebra4j.ZebraModel
-
The underlying solver
Model
- getChocoSettings() - Method in class zebra4j.AbstractPuzzleGenerator
- getChocoSettings() - Method in class zebra4j.PuzzleSolver
-
The settings for the underlying SAT solver
- getDistance() - Method in class zebra4j.fact.NearbyHouse
- getFacts() - Method in class zebra4j.BasicPuzzle
-
The facts that must be satisfied by any solution of the puzzle.
- getLeft() - Method in class zebra4j.fact.BothTrue
- getLeft() - Method in class zebra4j.fact.CommutativeFact
- getLeft() - Method in class zebra4j.fact.Different
- getLeft() - Method in class zebra4j.fact.NearbyHouse
- getPeople() - Method in class zebra4j.PuzzleSolution
-
The set of people with all of their attributed specified.
- getPosition() - Method in class zebra4j.AtHouse
-
The number of the position of the house from left to right, starting at 1.
- getQuestion() - Method in class zebra4j.QuestionPuzzle
-
A question about the people and their attributes, defined in the underlying basic puzzle.
- getRight() - Method in class zebra4j.fact.BothTrue
- getRight() - Method in class zebra4j.fact.CommutativeFact
- getRight() - Method in class zebra4j.fact.Different
- getRight() - Method in class zebra4j.fact.NearbyHouse
- getTowards() - Method in class zebra4j.Question
- getVariableFor(Attribute) - Method in class zebra4j.ZebraModel
-
Finds the variable for the given unique attribute
- GREEN - Enum constant in enum zebra4j.Clothes
H
- hasAttribute(Attribute) - Method in class zebra4j.SolutionPerson
- hashCode() - Method in class zebra4j.AtHouse
- hashCode() - Method in class zebra4j.BasicAttributeType
- hashCode() - Method in class zebra4j.BasicPuzzle
- hashCode() - Method in class zebra4j.fact.CommutativeFact
- hashCode() - Method in class zebra4j.fact.NearbyHouse
- hashCode() - Method in class zebra4j.PuzzleSolution
- hashCode() - Method in class zebra4j.Question
- hashCode() - Method in class zebra4j.QuestionPuzzle
- hashCode() - Method in class zebra4j.SolutionPerson
I
- initialize() - Method in class zebra4j.util.LazyInstance
- isEmpty() - Method in class zebra4j.util.CollectionChain
- iterator() - Method in class zebra4j.util.CollectionChain
- IVAN - Enum constant in enum zebra4j.PersonName
J
- JDKRandom - Class in zebra4j.util
-
Simple randomness implementation with
Random
- JDKRandom() - Constructor for class zebra4j.util.JDKRandom
- JDKRandom(long) - Constructor for class zebra4j.util.JDKRandom
- JDKRandom(Random) - Constructor for class zebra4j.util.JDKRandom
L
- LazyInstance<T> - Class in zebra4j.util
-
LazyInitializer
implementation based onSupplier
- LazyInstance(Supplier<T>) - Constructor for class zebra4j.util.LazyInstance
- Localization - Interface in zebra4j.util
M
- main(String[]) - Static method in class zebra4j.Cli
N
- NAME - Static variable in interface zebra4j.Attributes
- NAME_OF_CRIMINAL - Static variable in class zebra4j.Question
-
Sample question: Who is the criminal?
- NearbyHouse - Class in zebra4j.fact
-
Facts/clues about people with certain attributes living in adjacent or nearby houses.
- NearbyHouse(int, Attribute, Attribute) - Constructor for class zebra4j.fact.NearbyHouse
- nextInt(int) - Method in class zebra4j.util.JDKRandom
- nextInt(int) - Method in interface zebra4j.util.Randomness
-
Same as
Random.nextInt(int)
- NO - Enum constant in enum zebra4j.Criminal
- numPeople() - Method in class zebra4j.BasicPuzzle
P
- PersonName - Enum in zebra4j
-
The name attribute of a person
- PET - Static variable in interface zebra4j.Attributes
-
Pet attribute.
- PETER - Enum constant in enum zebra4j.PersonName
- PINK - Enum constant in enum zebra4j.Clothes
- postTo(ZebraModel) - Method in class zebra4j.fact.BothTrue
- postTo(ZebraModel) - Method in class zebra4j.fact.Different
- postTo(ZebraModel) - Method in interface zebra4j.fact.Fact
- postTo(ZebraModel) - Method in class zebra4j.fact.NearbyHouse
- PuzzleBuilder - Class in zebra4j
-
Builder for
BasicPuzzle
- PuzzleBuilder() - Constructor for class zebra4j.PuzzleBuilder
- PuzzleGenerator - Class in zebra4j
-
A generator for
BasicPuzzle
- PuzzleGenerator(PuzzleSolution, Set<Fact.Type>) - Constructor for class zebra4j.PuzzleGenerator
-
Generate a new random puzzle using default randomness source
- PuzzleGenerator(Randomness, PuzzleSolution, Set<Fact.Type>) - Constructor for class zebra4j.PuzzleGenerator
- PuzzleSolution - Class in zebra4j
-
A full solution to a
BasicPuzzle
- PuzzleSolutionBuilder - Class in zebra4j
-
Iterative builder for
PuzzleSolution
. - PuzzleSolutionBuilder() - Constructor for class zebra4j.PuzzleSolutionBuilder
- PuzzleSolver - Class in zebra4j
-
Solver for
BasicPuzzle
- PuzzleSolver(BasicPuzzle) - Constructor for class zebra4j.PuzzleSolver
-
Initialize a new solver with default configuration
Q
- Question - Class in zebra4j
-
A question about an attribute of a person
- Question(Attribute, AttributeType) - Constructor for class zebra4j.Question
- QuestionPuzzle - Class in zebra4j
-
A puzzle that looks for answer to the given question given rules defined by the attribute sets used in the underlying basic puzzle (e.g.
- QuestionPuzzle(Question, BasicPuzzle) - Constructor for class zebra4j.QuestionPuzzle
-
Creates a new instance by attaching a question to a basic puzzle
- QuestionPuzzleGenerator - Class in zebra4j
-
A generator for
QuestionPuzzle
- QuestionPuzzleGenerator(Question, PuzzleSolution, Set<Fact.Type>) - Constructor for class zebra4j.QuestionPuzzleGenerator
-
Creates a new generator with a default random generator
- QuestionPuzzleGenerator(Question, PuzzleSolution, Randomness, Set<Fact.Type>) - Constructor for class zebra4j.QuestionPuzzleGenerator
-
Creates a new generator for puzzles with the given solution assignment
- QuestionPuzzleSolver - Class in zebra4j
-
Solver for
QuestionPuzzle
- QuestionPuzzleSolver(QuestionPuzzle) - Constructor for class zebra4j.QuestionPuzzleSolver
-
Initialize a new solver with default configuration
- questionSentencePart(Locale) - Method in interface zebra4j.AttributeType
-
Returns the pattern for questions "about" this attribute type
- questionSentencePart(Locale) - Method in class zebra4j.BasicAttributeType
R
- Randomness - Interface in zebra4j.util
-
Data randomization, as used in zebra4j
- randomPuzzle(int) - Static method in class zebra4j.PuzzleGenerator
-
Generate a new random puzzle using defaults
- randomPuzzle(int) - Static method in class zebra4j.QuestionPuzzleGenerator
-
Generates a random puzzle seeded with a random solution, with all built-in facts and attributes.
- RED - Enum constant in enum zebra4j.Clothes
- rejectFact(Fact) - Method in class zebra4j.AbstractPuzzleGenerator
-
Checks if the fact is not compatible with the specific puzzle being generated
- rejectFact(Fact) - Method in class zebra4j.QuestionPuzzleGenerator
- remove(Object) - Method in class zebra4j.util.CollectionChain
- removeAll(Collection<?>) - Method in class zebra4j.util.CollectionChain
- removeFacts(List<Fact>) - Method in class zebra4j.AbstractPuzzleGenerator
-
Reduce the initial list of all compatible facts to the facts to use in the generated puzzle
- removeFacts(List<Fact>) - Method in class zebra4j.QuestionPuzzleGenerator
-
Optimized facts pruning for
QuestionPuzzle
- retainAll(Collection<?>) - Method in class zebra4j.util.CollectionChain
S
- setChocoSettings(Settings) - Method in class zebra4j.AbstractPuzzleGenerator
- setChocoSettings(Settings) - Method in class zebra4j.PuzzleSolver
-
The settings for the underlying SAT solver
- setChocoSettings(Settings) - Method in class zebra4j.QuestionPuzzleSolver
-
Configure the settings for the underlying SAT solver
- shuffle(List<?>) - Method in class zebra4j.util.JDKRandom
- shuffle(List<?>) - Method in interface zebra4j.util.Randomness
-
Shuffles the provided list in place
- size() - Method in class zebra4j.util.CollectionChain
- solution - Variable in class zebra4j.AbstractPuzzleGenerator
- SolutionGenerator - Class in zebra4j
-
Generator of
PuzzleSolution
- SolutionGenerator() - Constructor for class zebra4j.SolutionGenerator
-
Creates a generator with default configuration and largest possible puzzle size
- SolutionGenerator(int) - Constructor for class zebra4j.SolutionGenerator
-
Creates a generator with default configuration
- SolutionGenerator(Set<AttributeType>, int, Randomness) - Constructor for class zebra4j.SolutionGenerator
- SolutionPerson - Class in zebra4j
-
A specification of the attributes of a person in a solution of a
BasicPuzzle
- SolutionPerson(List<Attribute>) - Constructor for class zebra4j.SolutionPerson
-
Defines a person from their attributes
- SolutionPerson(Attribute...) - Constructor for class zebra4j.SolutionPerson
-
Defines a person from their attributes
- solve() - Method in class zebra4j.PuzzleSolver
-
Solves the puzzles eagerly.
- solve() - Method in class zebra4j.QuestionPuzzleSolver
- solveSingle() - Method in class zebra4j.QuestionPuzzleSolver
- solveToStream() - Method in class zebra4j.PuzzleSolver
- solveToStream() - Method in class zebra4j.QuestionPuzzleSolver
T
- THEODORA - Enum constant in enum zebra4j.PersonName
- toArray() - Method in class zebra4j.util.CollectionChain
- toArray(T[]) - Method in class zebra4j.util.CollectionChain
- toOptionalAttribute(IntVar) - Method in class zebra4j.ZebraModel
-
Checks if a variable is for person for some attribute
- toPuzzle(Collection<Fact>) - Method in class zebra4j.PuzzleGenerator
- toPuzzle(Collection<Fact>) - Method in class zebra4j.QuestionPuzzleGenerator
- toSolutionSet(Attribute[], int) - Static method in class zebra4j.AllDifferentType
-
Returns a list of the first "numPeople" elements of the given array
- toString() - Method in class zebra4j.AtHouse
- toString() - Method in class zebra4j.BasicAttributeType
- toString() - Method in class zebra4j.BasicPuzzle
- toString() - Method in class zebra4j.fact.BothTrue
- toString() - Method in class zebra4j.fact.Different
- toString() - Method in class zebra4j.fact.NearbyHouse
- toString() - Method in class zebra4j.PuzzleSolution
- toString() - Method in class zebra4j.Question
- toString() - Method in class zebra4j.QuestionPuzzle
- toString() - Method in class zebra4j.SolutionPerson
- translate(Class<?>, String, Locale) - Static method in interface zebra4j.util.Localization
- translateEnum(Enum<?>, Locale) - Static method in interface zebra4j.util.Localization
- type() - Method in class zebra4j.AtHouse
- type() - Method in interface zebra4j.Attribute
- type() - Method in enum zebra4j.Clothes
- type() - Method in enum zebra4j.Criminal
- type() - Method in enum zebra4j.PersonName
- TYPE - Static variable in class zebra4j.AtHouse
- TYPE - Static variable in enum zebra4j.Clothes
- TYPE - Static variable in enum zebra4j.Criminal
- TYPE - Static variable in class zebra4j.fact.BothTrue
- TYPE - Static variable in class zebra4j.fact.Different
- TYPE - Static variable in class zebra4j.fact.NearbyHouse
- TYPE - Static variable in enum zebra4j.PersonName
U
- uniqueSolution(P) - Method in class zebra4j.AbstractPuzzleGenerator
-
If the puzzle has a unique solution
- uniqueSolution(BasicPuzzle) - Method in class zebra4j.PuzzleGenerator
V
- valueOf(String) - Static method in enum zebra4j.Clothes
-
Returns the enum constant of this type with the specified name.
- valueOf(String) - Static method in enum zebra4j.Criminal
-
Returns the enum constant of this type with the specified name.
- valueOf(String) - Static method in enum zebra4j.PersonName
-
Returns the enum constant of this type with the specified name.
- values() - Static method in enum zebra4j.Clothes
-
Returns an array containing the constants of this enum type, in the order they are declared.
- values() - Static method in enum zebra4j.Criminal
-
Returns an array containing the constants of this enum type, in the order they are declared.
- values() - Static method in enum zebra4j.PersonName
-
Returns an array containing the constants of this enum type, in the order they are declared.
W
- withAttribute(Attribute) - Method in class zebra4j.SolutionPerson
Y
Z
- zebra4j - package zebra4j
-
zebra4j is a generator and solver for Zebra puzzles, a type of "logic grid puzzles".
- zebra4j.fact - package zebra4j.fact
-
Definition and implementation of facts.
- zebra4j.util - package zebra4j.util
-
Java utilities, mainly for data, which are not specific to zebra4j
- ZebraModel - Class in zebra4j
-
Wrapper on ChocoSolver
Model
adding variable management - ZebraModel(Settings) - Constructor for class zebra4j.ZebraModel
-
Initializes a new Zebra ChocoSolver model
All Classes|All Packages