|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectJSHOP2.InternalDomain
public class InternalDomain
Each domain at compile time is represented as an instance of this class.
Field Summary | |
---|---|
private java.util.Vector<InternalAxiom> |
axioms
A Vector of axioms seen so far in the domain description. |
private java.util.Vector<java.lang.String> |
calcs
A Vector of String names of user-defined
external code calls that must be imported before being used in the
domain description. |
private java.util.Vector<java.lang.String> |
compoundTasks
A Vector of String names of compound tasks seen
so far in the domain. |
private java.util.Vector<java.lang.String> |
constants
A Vector of String names of constant symbols
seen so far in the domain. |
private int |
constantsSize
The number of constant symbols already seen in the planning domain. |
(package private) static java.lang.String |
endl
The new line character in the platform JSHOP2 is running on. |
private java.util.Vector<InternalMethod> |
methods
A Vector of methods seen so far in the domain description. |
private java.lang.String |
name
The String name of the domain. |
private java.util.Vector<InternalOperator> |
operators
A Vector of operators seen so far in the domain description. |
private JSHOP2Parser |
parser
The parser object that will parse this domain. |
private int |
planNo
The number of solution plans per planning problem that the user has requested from this object. |
private java.util.Vector<java.lang.String> |
primitiveTasks
A Vector of String names of primitive tasks
seen so far in the domain. |
private java.lang.String |
probName
The String name of the planning problem. |
Constructor Summary | |
---|---|
InternalDomain(java.io.File fin,
int planNoIn)
To initialize this domain. |
Method Summary | |
---|---|
void |
addAxiom(InternalAxiom axiom)
To add an axiom to the list of axioms read from the file. |
void |
addCalc(java.lang.String what)
To add the String name of an external code call to the list
of such code calls. |
int |
addCompoundTask(java.lang.String s)
To add a String used as a name of a compound task in the
domain description to the list of compound task names, in case it has not
been added before. |
int |
addConstant(java.lang.String s)
To add a String used as a constant symbol in the domain
description to the list of constant symbols, in case it has not been
added before. |
void |
addMethod(InternalMethod method)
To add a method to the list of methods read from the file. |
void |
addOperator(InternalOperator op)
To add an operator to the list of operators read from the file. |
int |
addPrimitiveTask(java.lang.String s)
To add a String used as a name of a primitive task in the
domain description to the list of primitive task names, in case it has not
been added before. |
void |
close(int varsMaxSize)
This function writes the Java code necessary to produce this domain at run time in the appropriate file. |
void |
commandInitialize()
This function performs some necessary initialization when a problem file is being compiled, mainly reading and parsing the text file associated with the domain the planning problem is defined in. |
void |
commandToCode(java.util.LinkedList<java.util.Vector<Predicate>> states,
java.util.LinkedList<TaskList> taskLists)
This function writes the Java code necessary to produce these planning problems at run time in the appropriate file. |
void |
dumpStringArray(java.io.BufferedWriter dest,
java.util.Vector<?> list)
This function saves a given Vector of String s
in a given file. |
int |
getAxiomNo()
This function returns the number of axioms in this domain. |
java.util.Vector<java.lang.String> |
getCompoundTasks()
This function returns the Vector where the
String names of the compound tasks in this domain are
stored. |
java.util.Vector<java.lang.String> |
getConstants()
This function returns the Vector where the
String names of the constant symbols in this domain are
stored. |
int |
getMethodNo()
This function returns the number of methods in this domain. |
java.lang.String |
getName()
This function returns the String name of this domain. |
java.util.Vector<java.lang.String> |
getPrimitiveTasks()
This function returns the Vector where the
String names of the primitive tasks in this domain are
stored. |
static void |
main(java.lang.String[] args)
The main function that is called to do the compilation. |
int |
readStringArray(java.io.BufferedReader src,
java.util.Vector<java.lang.String> list)
This function reads a Vector of String s from
a given file. |
void |
setName(java.lang.String nameIn)
To set the name of this planning domain. |
void |
setProbName(java.lang.String probNameIn)
To set the name of this planning problem. |
java.lang.String |
vectorToCode(java.util.Vector<java.lang.String> list,
java.lang.String name)
This function produces the Java code needed to allocate and initialize an array the elements of which are drawn from a given Vector of
String s. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int planNo
private java.util.Vector<InternalAxiom> axioms
Vector
of axioms seen so far in the domain description.
Each member is of type InternalAxiom
.
private java.util.Vector<java.lang.String> calcs
Vector
of String
names of user-defined
external code calls that must be imported before being used in the
domain description.
private java.util.Vector<java.lang.String> compoundTasks
Vector
of String
names of compound tasks seen
so far in the domain.
private java.util.Vector<java.lang.String> constants
Vector
of String
names of constant symbols
seen so far in the domain.
private int constantsSize
static final java.lang.String endl
private java.util.Vector<InternalMethod> methods
Vector
of methods seen so far in the domain description.
Each member is of type InternalMethod
.
private java.lang.String name
String
name of the domain.
private java.util.Vector<InternalOperator> operators
Vector
of operators seen so far in the domain description.
Each member is of type InternalOperator
.
private JSHOP2Parser parser
private java.util.Vector<java.lang.String> primitiveTasks
Vector
of String
names of primitive tasks
seen so far in the domain.
private java.lang.String probName
String
name of the planning problem.
Constructor Detail |
---|
public InternalDomain(java.io.File fin, int planNoIn) throws java.io.IOException
fin
- the file from which the domain description is to be read.planNoIn
- the number of solution plans per planning problem that the user
has requested from this object.
java.io.IOException
Method Detail |
---|
public void addAxiom(InternalAxiom axiom)
axiom
- the axiom to be added.public int addCompoundTask(java.lang.String s)
String
used as a name of a compound task in the
domain description to the list of compound task names, in case it has not
been added before.
s
- the String
to be added.
public int addConstant(java.lang.String s)
String
used as a constant symbol in the domain
description to the list of constant symbols, in case it has not been
added before.
s
- the String
to be added.
public void addCalc(java.lang.String what)
String
name of an external code call to the list
of such code calls.
what
- the name of the code call being added.public void addMethod(InternalMethod method)
method
- the method to be added.public void addOperator(InternalOperator op)
op
- the operator to be added.public int addPrimitiveTask(java.lang.String s)
String
used as a name of a primitive task in the
domain description to the list of primitive task names, in case it has not
been added before.
s
- the String
to be added.
public void close(int varsMaxSize) throws java.io.IOException
varsMaxSize
- the maximum number of variables seen in any variable scope in
this domain.
java.io.IOException
public void commandInitialize() throws java.io.IOException
java.io.IOException
public void commandToCode(java.util.LinkedList<java.util.Vector<Predicate>> states, java.util.LinkedList<TaskList> taskLists) throws java.io.IOException
states
- the list of initial state of the world, one per each planning
problem.taskLists
- the list of the task lists to be achieved, one per each planning
problem.
java.io.IOException
public void dumpStringArray(java.io.BufferedWriter dest, java.util.Vector<?> list) throws java.io.IOException
Vector
of String
s
in a given file.
dest
- the file where the Vector
is to be saved.list
- the Vector
to be saved.
java.io.IOException
public int getAxiomNo()
public java.util.Vector<java.lang.String> getCompoundTasks()
Vector
where the
String
names of the compound tasks in this domain are
stored.
Vector
where the String
names of
the compound tasks in this domain are stored.public java.util.Vector<java.lang.String> getConstants()
Vector
where the
String
names of the constant symbols in this domain are
stored.
Vector
where the String
names of
the constant symbols in this domain are stored.public int getMethodNo()
public java.lang.String getName()
String
name of this domain.
String
name of this domain.public java.util.Vector<java.lang.String> getPrimitiveTasks()
Vector
where the
String
names of the primitive tasks in this domain are
stored.
Vector
where the String
names of
the primitive tasks in this domain are stored.public static void main(java.lang.String[] args) throws java.lang.Exception
args
- the command line arguments.
java.lang.Exception
public int readStringArray(java.io.BufferedReader src, java.util.Vector<java.lang.String> list) throws java.io.IOException
Vector
of String
s from
a given file.
src
- the input file.list
- the Vector
to be read.
Vector
.
java.io.IOException
public void setName(java.lang.String nameIn)
nameIn
- the name of this planning domain.public void setProbName(java.lang.String probNameIn)
probNameIn
- the name of this planning problem.public java.lang.String vectorToCode(java.util.Vector<java.lang.String> list, java.lang.String name)
Vector
of
String
s.
list
- the Vector
the elements of which are to be stored in
the resulting array.name
- the name of the array where the elements of the
Vector
are to be stored.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |