edu.udo.cs.ie.cowbots.logic
Class KProgram
java.lang.Object
edu.udo.cs.ie.cowbots.logic.KProgram
public class KProgram
- extends java.lang.Object
This class models a K-program which is needed as an input for the DLV-Component for planning. Such a program consists of fluent and action - declarations, rules, an initial state of the world a goal state which has to be reached
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
fluents
java.util.ArrayList<KDeclaration> fluents
actions
java.util.ArrayList<KDeclaration> actions
alwaysRules
java.util.ArrayList<KRule> alwaysRules
initiallyRules
java.util.ArrayList<KRule> initiallyRules
goal
java.util.ArrayList<ELPLiteral> goal
stepsToGoal
int stepsToGoal
knowledge
ELP knowledge
securePlan
boolean securePlan
noConcurrency
boolean noConcurrency
KProgram
public KProgram()
setSecurePlan
public void setSecurePlan(boolean securePlan)
setNoConcurrency
public void setNoConcurrency(boolean noConcurrency)
setStepsToGoal
public void setStepsToGoal(int stepsToGoal)
- Parameters:
stepsToGoal
- the stepsToGoal to set
addAction
public boolean addAction(KDeclaration a)
addFluent
public boolean addFluent(KDeclaration f)
addAlwaysRule
public boolean addAlwaysRule(KRule r)
addInitiallyRule
public boolean addInitiallyRule(KRule r)
addGoal
public boolean addGoal(ELPLiteral g)
setGoal
public void setGoal(ELPLiteral g)
addKnowledge
public void addKnowledge(ELPRule k)
setKnowledge
public void setKnowledge(ELP elp)
- Parameters:
elp
-
getKnowledge
public ELP getKnowledge()
- Returns:
- the knowledge
saveAs
public void saveAs(java.lang.String planName,
java.lang.String dlName)
- store KProgram on disc parted in two files, so it can be used by the K-solver
- Parameters:
planName
- output filename for the .plan part of the programdlName
- output filename for the .dl part of the program
testsave
public void testsave(java.lang.String name,
java.lang.String toSave)
saveKnowledge
public void saveKnowledge(java.lang.String dlName)
- store the knowledge of the program, so it can be used by the K-solver
- Parameters:
dlName
- output filename for the .dl part of the program
planPartToString
public java.lang.String planPartToString()
- Returns:
- a Sting which contains all the information of the program except the background knowledge
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object