Package MAKBPInterpreter.agents
Class KripkeWorld
- java.lang.Object
-
- MAKBPInterpreter.agents.KripkeWorld
-
public class KripkeWorld extends java.lang.Object
Class representing a world in aKripkeStructure
(node of the graph in this structure).
-
-
Constructor Summary
Constructors Constructor Description KripkeWorld(java.lang.String name, java.util.Map<Atom,java.lang.Boolean> assignment)
Default constructor.KripkeWorld(java.util.Map<Atom,java.lang.Boolean> assignment)
Constructor without world name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<Atom>
differencesBetweenWorlds(KripkeWorld world)
Returns the differences between two worlds (all atoms divergence).boolean
equals(java.lang.Object other)
java.util.Map<Atom,java.lang.Boolean>
getAssignment()
Gets all the true propositions of the world.java.lang.String
getName()
Gets the name of the world.int
hashCode()
boolean
satisfied(Formula formula, KripkeStructure structure)
Checks if a given formula is satisfying the actual state of the world.java.lang.String
toString()
-
-
-
Constructor Detail
-
KripkeWorld
public KripkeWorld(java.lang.String name, java.util.Map<Atom,java.lang.Boolean> assignment)
Default constructor.- Parameters:
name
- world nameassignment
- proposition of the world represents
-
KripkeWorld
public KripkeWorld(java.util.Map<Atom,java.lang.Boolean> assignment)
Constructor without world name.- Parameters:
assignment
- proposition of the world represents
-
-
Method Detail
-
satisfied
public boolean satisfied(Formula formula, KripkeStructure structure) throws java.lang.Exception
Checks if a given formula is satisfying the actual state of the world.- Parameters:
formula
- formula to satisfiedstructure
- Kripke structure- Returns:
- boolean representing if the world satisfied the formula
- Throws:
java.lang.Exception
- thrown if an illegal argument is passed
-
differencesBetweenWorlds
public java.util.Collection<Atom> differencesBetweenWorlds(KripkeWorld world)
Returns the differences between two worlds (all atoms divergence).- Parameters:
world
- other world- Returns:
- atoms set representing the divergence
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getName
public java.lang.String getName()
Gets the name of the world.- Returns:
- world name
-
getAssignment
public java.util.Map<Atom,java.lang.Boolean> getAssignment()
Gets all the true propositions of the world.- Returns:
- true propositions
-
-