Package jason.stdlib
Class save_agent
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.save_agent
- All Implemented Interfaces:
InternalAction,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)]): includesstartandsay(hello)as initial goals.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute(TransitionSystem ts, Unifier un, Term[] args) Executes the internal action.intintMethods inherited from class jason.asSemantics.DefaultInternalAction
canBeUsedInContext, checkArguments, destroy, prepareArguments, suspendIntention
-
Constructor Details
-
save_agent
public save_agent()
-
-
Method Details
-
getMinArgs
public int getMinArgs()- Overrides:
getMinArgsin classDefaultInternalAction
-
getMaxArgs
public int getMaxArgs()- Overrides:
getMaxArgsin classDefaultInternalAction
-
execute
Description copied from interface:InternalActionExecutes 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:
executein interfaceInternalAction- Overrides:
executein classDefaultInternalAction- Throws:
Exception
-