simulation

package
v0.0.0-...-cb691a1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

map to store dynamicaly association between message and visual tracks

Functions

This section is empty.

Types

type Simulation

type Simulation struct {
	// contains filtered or unexported fields
}

Simulation meets the gongsim_models.SimulationInterface

it is in a separate package from the models package because it handles the relation to the visual representation of the simulaton object with leaflet

func NewSimulation

func NewSimulation(
	gongflyStage *gongfly_models.StageStruct,
	gongsimStage *gongsim_models.StageStruct,
	gongleafletStage *gongleaflet_models.StageStruct) (simulation *Simulation)

NewSimulation ...

func (*Simulation) CheckoutAgents

func (simulation *Simulation) CheckoutAgents(engine *gongsim_models.Engine)

CheckoutAgents checkout all staged agents to the back repo

func (*Simulation) CommitAgents

func (simulation *Simulation) CommitAgents(engine *gongsim_models.Engine)

CommitAgent is called by the generic engine anytime a visual refresh is needed Commit will perform a write of all agent state to the back repo and the back repo will be checked out by the front repo (for display sake)

func (*Simulation) GetEngine

func (simulation *Simulation) GetEngine() (engine *gongsim_models.Engine)

func (*Simulation) GetLastCommitNb

func (simulation *Simulation) GetLastCommitNb() (commitNb uint)

GetLastCommitNb is used by the front repo to computer wether a checkout is necessary It does so by comparing successive commit nb

func (*Simulation) GetLastCommitNbFromFront

func (simulation *Simulation) GetLastCommitNbFromFront() (commitNb uint)

func (*Simulation) HasAnyStateChanged

func (simulation *Simulation) HasAnyStateChanged(engine *gongsim_models.Engine) bool

HasAnyStateChanged is used when the simulation user ask to advance up to the next state change. It is not implemented in this simulation

func (*Simulation) Reset

func (simulation *Simulation) Reset(engine *gongsim_models.Engine)

Reset simulation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL