Documentation ¶
Index ¶
- func NewAgent(name string)
- func NewAgentWithSetup(name string, setUp setupFunc)
- func NewAgentWithSetupAndTakeDown(name string, setUp setupFunc, takeDown takeDownFunc)
- func RegisterAgent(a *Agent)
- func RegisterAgentAndScale(a *Agent, scale int)
- func RegisterAndRunAgent(wg *sync.WaitGroup, agent *Agent)
- func Start()
- func StartAgent(wg *sync.WaitGroup, agent *Agent)
- func StopAgent(agentID string)
- type Agent
- func (a *Agent) AddCyclicBehaviour(b Behaviour)
- func (a *Agent) AddOneShotBehaviour(b Behaviour)
- func (a *Agent) AddTickerBehaviour(b DelayedBehaviour, tickerSecond int)
- func (a *Agent) AddWakerBehaviour(b DelayedBehaviour, timeoutSecond int)
- func (a *Agent) GetData(key string) string
- func (a *Agent) OnMessage(om func(message.Message))
- func (a *Agent) Send(msg message.Message)
- func (a *Agent) SendMessage(receiver string, msgBody string)
- func (a *Agent) SetData(key string, data string)
- type AgentStore
- type Behaviour
- type DelayedBehaviour
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAgentWithSetup ¶
func NewAgentWithSetup(name string, setUp setupFunc)
NewAgentWithSetup create a new Agent with a setUp function. the setup function will be executed before starting the agent
func NewAgentWithSetupAndTakeDown ¶
func NewAgentWithSetupAndTakeDown(name string, setUp setupFunc, takeDown takeDownFunc)
NewAgentWithSetupAndTakeDown create a new Agent with a setUp and Takedown function. the setup function will be executed before starting the agent the takeDown function will be executed after all agent behaviour. before agent end of life
func RegisterAgentAndScale ¶
RegisterAgentAndScale register a new Agent and scale
func RegisterAndRunAgent ¶
RegisterAndRunAgent ...
Types ¶
type Agent ¶
type Agent struct { Name string ID string Setup setupFunc TakeDown takeDownFunc // contains filtered or unexported fields }
Agent ...
func (*Agent) AddCyclicBehaviour ¶
AddCyclicBehaviour add new cyclic behaviour to the agent cyclic behaviours never complete and run forever
func (*Agent) AddOneShotBehaviour ¶
AddOneShotBehaviour add new behaviour to the agent
func (*Agent) AddTickerBehaviour ¶
func (a *Agent) AddTickerBehaviour(b DelayedBehaviour, tickerSecond int)
AddTickerBehaviour add new ticker behaviour to the agent waker behaviours execute repetitively after a given period of time
func (*Agent) AddWakerBehaviour ¶
func (a *Agent) AddWakerBehaviour(b DelayedBehaviour, timeoutSecond int)
AddWakerBehaviour add new waker behaviour to the agent waker behaviours execute after a given timeout
func (*Agent) SendMessage ¶
SendMessage send Inform Message
type AgentStore ¶
AgentStore ...