Documentation
¶
Overview ¶
Example (PingWithEvents) ¶
engine := sim.NewSerialEngine() // agentA := NewPingAgent("AgentA", engine) agentA := MakeBuilder().WithEngine(engine).Build("AgentA") // agentB := NewPingAgent("AgentB", engine) agentB := MakeBuilder().WithEngine(engine).Build("AgentB") conn := directconnection.MakeBuilder().WithEngine(engine).WithFreq(1 * sim.GHz).Build("Conn") conn.PlugIn(agentA.OutPort, 1) conn.PlugIn(agentB.OutPort, 1) e1 := StartPingEvent{ EventBase: sim.NewEventBase(1, agentA), Dst: agentB.OutPort, } e2 := StartPingEvent{ EventBase: sim.NewEventBase(3, agentA), Dst: agentB.OutPort, } engine.Schedule(e1) engine.Schedule(e2) engine.Run()
Output: Ping 0, 2.00 Ping 1, 2.00
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
func MakeBuilder ¶
func MakeBuilder() Builder
type Comp ¶
type Comp struct { *sim.ComponentBase Engine sim.Engine OutPort sim.Port // contains filtered or unexported fields }
func (Comp) NotifyPortFree ¶
func (*Comp) NotifyRecv ¶
func (*Comp) RspPing ¶
func (c *Comp) RspPing(evt RspPingEvent)
func (*Comp) StartPing ¶
func (c *Comp) StartPing(evt StartPingEvent)
type PingReq ¶
func (*PingReq) GenerateRsp ¶
type RspPingEvent ¶
Click to show internal directories.
Click to hide internal directories.