Pipeline Processing

Generated by GenServerVirtualTime โ€ข Mermaid Flowchart

๐Ÿ“ˆ Simulation Summary

Virtual Time
1000ms
Real Time
10ms
Speedup
100.0x
Termination
โฑ Max Time

๐Ÿ“Š Actor Topology

flowchart TB source(["source
๐Ÿ“ค Sent: 10
๐Ÿ“ฅ Recv: 0"]) sink["sink
๐Ÿ“ค Sent: 0
๐Ÿ“ฅ Recv: 10"] stage1("stage1
๐Ÿ“ค Sent: 10
๐Ÿ“ฅ Recv: 10") stage2("stage2
๐Ÿ“ค Sent: 10
๐Ÿ“ฅ Recv: 10") source -->|:request
every 100ms| stage1 stage1 -->|:request
10/s| stage2 stage2 -->|:request
10/s| sink style source fill:#e8f5e9,stroke:#388e3c style sink fill:#e8f5e9,stroke:#388e3c style stage1 fill:#e8f5e9,stroke:#388e3c style stage2 fill:#e8f5e9,stroke:#388e3c

Node Shapes (Actor Type)

flowchart TD legend_source(["Source
(sends only)"]) legend_processor("Processor
(send & receive)") legend_sink["Sink
(receives only)"] style legend_source fill:#ffffff,stroke:#666666,stroke-width:2px style legend_processor 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
source 10 0 10.0 msg/s 0.0 msg/s 10 total
sink 0 10 0.0 msg/s 10.0 msg/s 10 total
stage1 10 10 10.0 msg/s 10.0 msg/s 20 total
stage2 10 10 10.0 msg/s 10.0 msg/s 20 total
Summary: Total messages: 60 โ€ข Duration: 1000ms โ€ข Actors: 4

๐Ÿ’ป Model Source Code

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

# Create a more complex pipeline with forwarding logic
forward = fn msg, state ->
  {:send, [{state.next, msg}], state}
end

simulation =
  ActorSimulation.new()
  |> ActorSimulation.add_actor(:source,
    send_pattern: {:periodic, 100, :request},
    targets: [:stage1]
  )
  |> ActorSimulation.add_actor(:stage1,
    on_receive: forward,
    initial_state: %{next: :stage2}
  )
  |> ActorSimulation.add_actor(:stage2,
    on_receive: forward,
    initial_state: %{next: :sink}
  )
  |> ActorSimulation.add_actor(:sink)
  |> ActorSimulation.run(duration: 1000)

# Generate the report
html = MermaidReportGenerator.generate_report(simulation,
  title: "Pipeline Processing",
  show_stats_on_nodes: true,
  model_source: model_source
)