Package MAKBPInterpreter.agents
Class KripkeWorld
- java.lang.Object
-
- MAKBPInterpreter.agents.KripkeWorld
-
public class KripkeWorld extends java.lang.ObjectClass 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).booleanequals(java.lang.Object other)java.util.Map<Atom,java.lang.Boolean>getAssignment()Gets all the true propositions of the world.java.lang.StringgetName()Gets the name of the world.inthashCode()booleansatisfied(Formula formula, KripkeStructure structure)Checks if a given formula is satisfying the actual state of the world.java.lang.StringtoString()
-
-
-
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:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein 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
-
-