Early Termination Test

Generated by GenServerVirtualTime โ€ข Mermaid Flowchart

๐Ÿ“ˆ Simulation Summary

Virtual Time
1000ms
Real Time
10ms
Speedup
100.0x
Termination
โšก Early

๐Ÿ“Š Actor Topology

flowchart TB receiver["receiver
๐Ÿ“ค Sent: 0
๐Ÿ“ฅ Recv: 10"] sender(["sender
๐Ÿ“ค Sent: 10
๐Ÿ“ฅ Recv: 0"]) sender -->|:msg
every 100ms| receiver style receiver fill:#e8f5e9,stroke:#388e3c style sender fill:#e8f5e9,stroke:#388e3c

Node Shapes (Actor Type)

flowchart TD legend_source(["Source
(sends only)"]) legend_sink["Sink
(receives only)"] style legend_source fill:#ffffff,stroke:#666666,stroke-width:2px style legend_sink fill:#ffffff,stroke:#666666,stroke-width:2px

Node Colors (Activity Level)

flowchart LR activity_0["๐ŸŸข Medium Activity (10-50 msgs)"] style activity_0 fill:#e8f5e9,stroke:#388e3c

๐Ÿ“‰ Detailed Statistics

Actor Sent Received Send Rate Receive Rate Activity
receiver 0 10 0.0 msg/s 10.0 msg/s 10 total
sender 10 0 10.0 msg/s 0.0 msg/s 10 total
Summary: Total messages: 20 โ€ข Duration: 1000ms โ€ข Actors: 2

๐Ÿ’ป Model Source Code

This is the Elixir code that defines the actor simulation model:

simulation =
  ActorSimulation.new()
  |> ActorSimulation.add_actor(:sender,
    send_pattern: {:periodic, 100, :msg},
    targets: [:receiver]
  )
  |> ActorSimulation.add_actor(:receiver)
  |> ActorSimulation.run(
    max_duration: 10_000,
    terminate_when: fn sim ->
      stats = ActorSimulation.collect_current_stats(sim)
      sender_stats = Map.get(stats.actors, :sender)
      sender_stats && sender_stats.sent_count >= 10
    end
  )