Package jason.stdlib
Class save_agent
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.save_agent
- All Implemented Interfaces:
InternalAction
,java.io.Serializable
@Manual(literal=".save_agent(file[,initial_goals])", hint="stores the beliefs, rules, and plans of the agent into a file", argsHint={"the name of the file","the list of initial goals that will be included in the file [optional]"}, argsType={"string","list"}, examples={".save_agent(\"/tmp/x.asl\"): save the agent at file \"/tmp/x.asl\"",".save_agent(\"/tmp/x.asl\", [start, say(hello)]): includes start and say(hello) as initial goals"}, seeAlso={"jason.stdlib.create_agent","jason.stdlib.kill_agent","jason.stdlib.stopMAS","jason.runtime.RuntimeServices"}) public class save_agent extends DefaultInternalAction
Internal action: .save_agent
.
Description: stores the beliefs, rules, and plans of the agent into a file.
Parameters:
- + file name (atom, string, or variable): the name of the file.
- + initial goals (list -- optional): list of initial goals that will be included in the file.
Examples:
-
.save_agent("/tmp/x.asl")
: save the agent at file "/tmp/x.asl". -
.save_agent("/tmp/x.asl", [start, say(hello)])
: includesstart
andsay(hello)
as initial goals.
- See Also:
kill_agent
,create_agent
,stopMAS
,RuntimeServices
,list_files
, Serialized Form
-
Constructor Summary
Constructors Constructor Description save_agent()
-
Method Summary
Modifier and Type Method Description java.lang.Object
execute(TransitionSystem ts, Unifier un, Term[] args)
Executes the internal action.int
getMaxArgs()
int
getMinArgs()
Methods inherited from class jason.asSemantics.DefaultInternalAction
canBeUsedInContext, checkArguments, destroy, prepareArguments, suspendIntention
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
save_agent
public save_agent()
-
-
Method Details
-
getMinArgs
public int getMinArgs()- Overrides:
getMinArgs
in classDefaultInternalAction
-
getMaxArgs
public int getMaxArgs()- Overrides:
getMaxArgs
in classDefaultInternalAction
-
execute
public java.lang.Object execute(TransitionSystem ts, Unifier un, Term[] args) throws java.lang.ExceptionDescription copied from interface:InternalAction
Executes the internal action. It should return a Boolean or an Iterator. A true boolean return means that the IA was successfully executed. An Iterator result means that there is more than one answer for this IA (e.g. see member internal action). - Specified by:
execute
in interfaceInternalAction
- Overrides:
execute
in classDefaultInternalAction
- Throws:
java.lang.Exception
-