Package MAKBPInterpreter.agents
Class CommonKnowledge
- java.lang.Object
-
- MAKBPInterpreter.agents.CommonKnowledge
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<Agent>
agents
Agent set where each agent knows the associated formula.protected Formula
innerFormula
Common formula knows by all the agents.
-
Constructor Summary
Constructors Constructor Description CommonKnowledge(Formula formula, java.util.Set<Agent> agents)
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(Formula otherFormula)
Returnstrue
if this formula contains the specified formula.boolean
equals(java.lang.Object other)
Verifies if the current object formula andother
formula are the same.boolean
evaluate(LogicAssignment assignment)
java.util.Set<Agent>
getAgents()
Gets the agent set where each agent knows the associated formula.Formula
getInnerFormula()
Gets the inner formula object.Formula
getNegation()
Returns the negation of the current formula.int
hashCode()
Formula
simplify()
Simplifies the logic formula.
-
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object other)
Description copied from interface:Formula
Verifies if the current object formula andother
formula are the same.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
simplify
public Formula simplify()
Description copied from interface:Formula
Simplifies the logic formula.
-
getNegation
public Formula getNegation()
Description copied from interface:Formula
Returns the negation of the current formula.- Specified by:
getNegation
in interfaceFormula
- Returns:
- negation of formula
-
contains
public boolean contains(Formula otherFormula)
Description copied from interface:Formula
Returnstrue
if this formula contains the specified formula.
-
getInnerFormula
public Formula getInnerFormula()
Gets the inner formula object.- Returns:
- inner formula object
- See Also:
innerFormula
-
getAgents
public java.util.Set<Agent> getAgents()
Gets the agent set where each agent knows the associated formula.- Returns:
- agent set
-
evaluate
public boolean evaluate(LogicAssignment assignment) throws java.lang.Exception
Evaluates the everybody knowledge offormula
in all accessible worlds by all agents of the groupagents
. An adapted Breadth-first search where at each world, an evaluation of EK was realized. This algorithm represents the infinite depth in theory but limited by the number of edges and vertices of the Kripke structure.
-
-