|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jscience.computing.ai.planning.InternalDomain
public class InternalDomain
Each domain at compile time is represented as an instance of this class.
Constructor Summary | |
---|---|
InternalDomain(java.io.File fin,
java.lang.String[] argsIn)
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.Vector state,
TaskList tl)
This function writes the Java code necessary to produce this planning problem 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 |
getCompoundTasks()
This function returns the Vector where the
String names of the compound tasks in this domain are
stored. |
java.util.Vector |
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 |
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 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 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 |
Constructor Detail |
---|
public InternalDomain(java.io.File fin, java.lang.String[] argsIn) throws java.io.IOException
fin
- the file from which the domain description is to be read.argsIn
- the argument list passed to this class.
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.Vector state, TaskList tl) throws java.io.IOException
state
- the initial state of the world in the planning problem.tl
- the task list to be achieved.
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 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 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 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 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 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 |