Package jason.stdlib

Class create_agent

All Implemented Interfaces:
InternalAction, Serializable

@Manual(literal=".create_agent(name[,source,customisations])", hint="creates agent using the referred AgentSpeak source code", argsHint={"the name for the new agent","path to the AgentSpeak code file [optional]","list of optional parameters [optional]"}, argsType={"atom, string, or variable","string","list"}, examples={".create_agent(bob,\"/tmp/x.asl\"): creates an agent named \"bob\" from the source file in \"/tmp/x.asl\"",".create_agent(Bob,\"/tmp/x.asl\"): creates an agent named \"bob\" (or \"bob_1\", \"bob_2\", ...) and unifies variable Bob with the given name",".create_agent(bob,\"x.asl\", [agentClass(\"myp.MyAgent\")]): creates the agent \"bob\" with customised agent class myp.MyAgent",".create_agent(bob,\"x.asl\", [agentArchClass(\"myp.MyArch\")]): creates the agent with customised architecture class myp.MyArch",".create_agent(bob,\"x.asl\", [beliefBaseClass(\"jason.bb.TextPersistentBB\")]): creates the agent with customised belief base jason.bb.TextPersistentBB",".create_agent(bob,\"x.asl\", [agentClass(\"myp.MyAgent\"),\tagentArchClass(\"myp.MyArch\"), beliefBaseClass(\"jason.bb.TextPersistentBB\")]): creates the customized agent"}, seeAlso={"jason.stdlib.save_agent","jason.stdlib.kill_agent","jason.stdlib.stopMAS","jason.runtime.RuntimeServices"}) public class create_agent extends DefaultInternalAction

Internal action: .create_agent.

Description: creates another agent using the referred AgentSpeak source code.

Parameters:

  • + name (atom, string, or variable): the name for the new agent. If this parameter is a variable, it will be unified with the name given to the agent. The agent's name will be the name of the variable and some number that makes it unique.
  • + source (string -- optional): path to the file where the AgentSpeak code for the new agent can be found.
  • + customisations (list -- optional): list of optional parameters as agent class, architecture and belief base.

Examples:

  • .create_agent(bob,"/tmp/x.asl"): creates an agent named "bob" from the source file in "/tmp/x.asl".
  • .create_agent(Bob,"/tmp/x.asl"): creates an agent named "bob" (or "bob_1", "bob_2", ...) and unifies variable Bob with the given name.
  • .create_agent(bob,"x.asl", [agentClass("myp.MyAgent")]): creates the agent with customised agent class myp.MyAgent.
  • .create_agent(bob,"x.asl", [agentArchClass("myp.MyArch")]): creates the agent with customised architecture class myp.MyArch.
  • .create_agent(bob,"x.asl", [beliefBaseClass("jason.bb.TextPersistentBB")]): creates the agent with customised belief base jason.bb.TextPersistentBB.
  • .create_agent(bob,"x.asl", [agentClass("myp.MyAgent"), agentArchClass("myp.MyArch"), beliefBaseClass("jason.bb.TextPersistentBB")]): creates the agent with agent, architecture and belief base customised.
See Also: