ix.test
Class FilePlanner
java.lang.Object
ix.test.PlanningTest
ix.test.FilePlanner
public class FilePlanner
- extends PlanningTest
A Utility for running planning problems with files as input and output.
Parameters:
- domain=filename
-
The domain to use when planning. A
ParameterException
will be thrown if no domain is given.
- plan=filename
-
A initial plan that sets up the planning problem. This is optional,
but if it is not given, a task must be, or else a ParameterException
will be thrown.
- task=activity-pattern
-
This is an alternative to specifying a plan, although
both can be given. The pattern is turned into an activity
which is then added to the initial plan that's given to the
planner. The pattern is typically a sequence of words, numbers,
etc separated by spaces, that is meaningful in the domain.
For example, "test1", "drive-to Glasgow".
- number-of-plans=integer
-
The number of plans to generate (defaults to 1).
- output-directory=filename
-
The directory where output plans should be put. If no directory
is specified, the directory containing the initial plan is used,
if an initial plan was given, or else the directory containing
the domain.
- output-file-type=string
-
The file type to use for output plans. If this is not specified,
the type of the initial plan's file is used, if an initial plan
was given; otherwise, the type defaults to "xml".
- test=true or false
-
If true, plans are generated as usual, but no files are created.
If this parameter is not specified, it is assumed to be false.
Method Summary |
protected void |
checkThatEnoughParametersWereGiven()
|
static void |
main(java.lang.String[] argv)
|
protected java.lang.String |
namePart(java.io.File file)
Returns the name from a File, leaving out the directory and
any file type. |
protected void |
outputPlan(Plan plan)
|
protected void |
run()
|
protected java.lang.String |
savedPlanName()
Constructs a file name for a plan based on the domain name
plus the task, if one was specified, or else the name of
the initial plan. |
protected void |
setup()
|
protected java.lang.String |
taskDescription()
Returns a short textual description of the task or problem
that's been given to the planner. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
outputDirecoryName
protected java.lang.String outputDirecoryName
outputFileType
protected java.lang.String outputFileType
testOnly
protected boolean testOnly
domainFile
protected java.io.File domainFile
planFile
protected java.io.File planFile
outputDirecoryFile
protected java.io.File outputDirecoryFile
numberOfPlans
protected int numberOfPlans
planNumber
protected int planNumber
FilePlanner
public FilePlanner()
main
public static void main(java.lang.String[] argv)
run
protected void run()
- Overrides:
run
in class PlanningTest
setup
protected void setup()
- Overrides:
setup
in class PlanningTest
checkThatEnoughParametersWereGiven
protected void checkThatEnoughParametersWereGiven()
outputPlan
protected void outputPlan(Plan plan)
savedPlanName
protected java.lang.String savedPlanName()
- Constructs a file name for a plan based on the domain name
plus the task, if one was specified, or else the name of
the initial plan. The parts are separated by dashes, and
any spaces in the task are replaced by dashes. If the
initial plan's name begins with the domain name, followed
by a dash, that part is removed, so that it doesn't appear twice,
and replaced by "starting-from-".
- See Also:
taskDescription()
namePart
protected java.lang.String namePart(java.io.File file)
- Returns the name from a File, leaving out the directory and
any file type.
taskDescription
protected java.lang.String taskDescription()
- Returns a short textual description of the task or problem
that's been given to the planner.
The result is the task string, if one was specified,
or else the name of the initial plan. If the initial-plan
string begins with the domain name (followed by a dash),
those characters are removed from the description, as are
any characters after and including any final ".". The
domain part is replaced by "starting-from". For example,
if the domain is "example" and initial-plan is
"example-init-plan.xml", the result will
be "starting-from-init-plan".