class Quartz::Simulation

Overview

This class represent the interface to the simulation

Included Modules

Defined in:

quartz/simulation.cr

Constructors

Instance Method Summary

Instance methods inherited from class Reference

==(other : Quartz::Any) ==

Instance methods inherited from class Object

===(other : Quartz::Any) ===

Constructor Detail

def self.new(model : Model, *, scheduler : Symbol = :binary_heap, maintain_hierarchy : Bool = true, duration : Duration | TimePoint = Duration::INFINITY, run_validations : Bool = false, notifier : Hooks::Notifier = Hooks::Notifier.new) #

[View source]

Instance Method Detail

def abort #

Abort the currently running or initialized simulation. Goes to an aborted state.


[View source]
def aborted?(*args, **options) #

[View source]
def aborted?(*args, **options, &) #

[View source]
def default_scheduler : Symbol #

Returns the default scheduler to use.


[View source]
def done?(*args, **options) #

[View source]
def done?(*args, **options, &) #

[View source]
def each #
Description copied from module Iterable(Quartz::Duration)

Must return an Iterator over the elements in this collection.


[View source]
def each(&) #
Description copied from module Enumerable(Quartz::Duration)

Must yield this collection's elements to the block.


[View source]
def elapsed_secs #

[View source]
def final_time : Time::Span? #

[View source]
def generate_graph(io : IO) #

[View source]
def generate_graph(path = "model_hierarchy.dot") #

[View source]
def initialize_simulation #

[View source]
def initialized?(*args, **options) #

[View source]
def initialized?(*args, **options, &) #

[View source]
def inspect(io) #

[View source]
def model : Quartz::CoupledModel #

[View source]
def notifier : Hooks::Notifier #

[View source]
def percentage #

[View source]
def ready?(*args, **options) #

[View source]
def ready?(*args, **options, &) #

[View source]
def restart #

Restart a terminated simulation (either done or aborted) and goes to a ready state.


[View source]
def run_validations? : Bool #

Whether Quartz::Validations will be run during simulation.


[View source]
def running?(*args, **options) #

[View source]
def running?(*args, **options, &) #

[View source]
def simulate #

TODO error hook


[View source]
def start_time : Time::Span? #

[View source]
def status : Status #

[View source]
def step : Duration | Nil #

[View source]
def termination_condition(&block : TimePoint, CoupledModel -> Bool) #

Set the termination condition


[View source]
def transition_stats #

Returns the number of transitions per model along with the total


[View source]
def virtual_time : TimePoint #

[View source]