Skip to content

Commit

Permalink
engine in simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
syifan committed May 23, 2024
1 parent 231c1ec commit aad7eb3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sim/simulation.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package sim

// A Simulation provides the service requires to define a simulation.
type Simulation struct {
engine Engine
components []Component
compNameIndex map[string]int
ports []Port
Expand All @@ -16,6 +17,16 @@ func NewSimulation() *Simulation {
}
}

// RegisterEngine registers the engine used in the simulation.
func (s *Simulation) RegisterEngine(e Engine) {
s.engine = e
}

// GetEngine returns the engine used in the simulation.
func (s *Simulation) GetEngine() Engine {
return s.engine
}

// RegisterComponent registers a component with the simulation.
func (s *Simulation) RegisterComponent(c Component) {
compName := c.Name()
Expand Down

0 comments on commit aad7eb3

Please sign in to comment.