edu.udo.cs.ie.cowbots.logic
Class KProgram

Package class diagram package KProgram
java.lang.Object
  extended by 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


Field Summary
(package private)  java.util.ArrayList<KDeclaration> actions
           
(package private)  java.util.ArrayList<KRule> alwaysRules
           
(package private)  java.util.ArrayList<KDeclaration> fluents
           
(package private)  java.util.ArrayList<ELPLiteral> goal
           
(package private)  java.util.ArrayList<KRule> initiallyRules
           
(package private)  ELP knowledge
           
(package private)  boolean noConcurrency
           
(package private)  boolean securePlan
           
(package private)  int stepsToGoal
           
 
Constructor Summary
KProgram()
           
 
Method Summary
 boolean addAction(KDeclaration a)
           
 boolean addAlwaysRule(KRule r)
           
 boolean addFluent(KDeclaration f)
           
 boolean addGoal(ELPLiteral g)
           
 boolean addInitiallyRule(KRule r)
           
 void addKnowledge(ELPRule k)
           
 ELP getKnowledge()
           
 java.lang.String planPartToString()
           
 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
 void saveKnowledge(java.lang.String dlName)
          store the knowledge of the program, so it can be used by the K-solver
 void setGoal(ELPLiteral g)
           
 void setKnowledge(ELP elp)
           
 void setNoConcurrency(boolean noConcurrency)
           
 void setSecurePlan(boolean securePlan)
           
 void setStepsToGoal(int stepsToGoal)
           
 void testsave(java.lang.String name, java.lang.String toSave)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

KProgram

public KProgram()
Method Detail

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 program
dlName - 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