Documentation
¶
Index ¶
- type BaseServer
- func (serv *BaseServer[T]) AccessAgentByID(id uuid.UUID) T
- func (serv *BaseServer[T]) AddAgent(agent T)
- func (serv *BaseServer[T]) AgentStoppedTalking(id uuid.UUID)
- func (server *BaseServer[T]) DeliverMessage(msg message.IMessage[T], recipient uuid.UUID)
- func (serv *BaseServer[T]) GetAgentMap() map[uuid.UUID]T
- func (serv *BaseServer[T]) GetAgentMessagingBandwidth() int
- func (serv *BaseServer[T]) GetDiagnosticEngine() diagnosticsEngine.IDiagnosticsEngine
- func (serv *BaseServer[T]) GetIterations() int
- func (serv *BaseServer[T]) GetTurns() int
- func (serv *BaseServer[T]) RemoveAgent(agentToRemove T)
- func (server *BaseServer[T]) ReportMessagingDiagnostics()
- func (serv *BaseServer[T]) RunEndOfIteration(iteration int)
- func (serv *BaseServer[T]) RunStartOfIteration(iteration int)
- func (serv *BaseServer[T]) RunTurn(turn, iteration int)
- func (serv *BaseServer[T]) SetGameRunner(handler GameRunner)
- func (serv *BaseServer[T]) Start()
- func (serv *BaseServer[T]) ViewAgentIdSet() map[uuid.UUID]struct{}
- type GameRunner
- type IAgentOperations
- type IGameStateController
- type IServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseServer ¶
func CreateBaseServer ¶ added in v2.1.0
func CreateBaseServer[T agent.IAgent[T]](iterations, turns int, turnMaxDuration time.Duration, messageBandwidth int) *BaseServer[T]
generate a server instance based on a mapping function and number of iterations
func (*BaseServer[T]) AccessAgentByID ¶
func (serv *BaseServer[T]) AccessAgentByID(id uuid.UUID) T
func (*BaseServer[T]) AddAgent ¶
func (serv *BaseServer[T]) AddAgent(agent T)
func (*BaseServer[T]) AgentStoppedTalking ¶
func (serv *BaseServer[T]) AgentStoppedTalking(id uuid.UUID)
func (*BaseServer[T]) DeliverMessage ¶
func (server *BaseServer[T]) DeliverMessage(msg message.IMessage[T], recipient uuid.UUID)
func (*BaseServer[T]) GetAgentMap ¶
func (serv *BaseServer[T]) GetAgentMap() map[uuid.UUID]T
func (*BaseServer[T]) GetAgentMessagingBandwidth ¶
func (serv *BaseServer[T]) GetAgentMessagingBandwidth() int
func (*BaseServer[T]) GetDiagnosticEngine ¶ added in v2.1.0
func (serv *BaseServer[T]) GetDiagnosticEngine() diagnosticsEngine.IDiagnosticsEngine
func (*BaseServer[T]) GetIterations ¶
func (serv *BaseServer[T]) GetIterations() int
func (*BaseServer[T]) GetTurns ¶
func (serv *BaseServer[T]) GetTurns() int
func (*BaseServer[T]) RemoveAgent ¶
func (serv *BaseServer[T]) RemoveAgent(agentToRemove T)
func (*BaseServer[T]) ReportMessagingDiagnostics ¶ added in v2.1.0
func (server *BaseServer[T]) ReportMessagingDiagnostics()
func (*BaseServer[T]) RunEndOfIteration ¶
func (serv *BaseServer[T]) RunEndOfIteration(iteration int)
func (*BaseServer[T]) RunStartOfIteration ¶
func (serv *BaseServer[T]) RunStartOfIteration(iteration int)
func (*BaseServer[T]) RunTurn ¶
func (serv *BaseServer[T]) RunTurn(turn, iteration int)
func (*BaseServer[T]) SetGameRunner ¶
func (serv *BaseServer[T]) SetGameRunner(handler GameRunner)
func (*BaseServer[T]) Start ¶
func (serv *BaseServer[T]) Start()
func (*BaseServer[T]) ViewAgentIdSet ¶
func (serv *BaseServer[T]) ViewAgentIdSet() map[uuid.UUID]struct{}
type GameRunner ¶
type IAgentOperations ¶
type IGameStateController ¶ added in v2.1.0
type IGameStateController interface { // gives access to number of iteration in simulator GetIterations() int // gives access to number of turns in simulator GetTurns() int // injects a GameRunner interface into the server SetGameRunner(GameRunner) // begins simulator Start() }
type IServer ¶
type IServer[T agent.IAgent[T]] interface { // gives operations for adding/removing agents from the simulator IAgentOperations[T] // exposes server methods to agents for messaging, etc agent.IExposedServerFunctions[T] // exposes server methods for controlling game state IGameStateController // toggle logging of messaging diagnostics to console (default false) ReportMessagingDiagnostics() }
Click to show internal directories.
Click to hide internal directories.