class Quartz::CoupledModel
- Quartz::CoupledModel
- Quartz::Model
- Reference
- Object
Overview
This class represent a PDEVS coupled model.
Included Modules
Direct Known Subclasses
Defined in:
quartz/coupled.crquartz/visitor.cr
Class Method Summary
- .preferred_event_set : Symbol
- .preferred_event_set=(preferred_event_set : Symbol)
- .preferred_event_set? : Symbol?
Instance Method Summary
Macro Summary
-
event_set(name)
Defines the preferred event set for this particular class of coupled models.
-
input(*names)
Defines default input ports for each of the given arguments.
-
output(*names)
Defines default output ports for each of the given arguments.
Instance methods inherited from module Quartz::Observable
add_observer(observer : Observer)
add_observer,
count_observers
count_observers,
delete_observer(observer : Observer) : Bool
delete_observer,
notify_observers(info = nil)
notify_observers
Instance methods inherited from module Quartz::Coupler
<<(model : Model)
<<,
[](name : Name) : Model
[],
[]?(name : Name) : Model?
[]?,
add_child(child)
add_child,
attach(p1 : OutputPort, to p2 : InputPort)attach(p1 : Name, *, to p2 : Name, between sender : Name, and receiver : Name, &block : Enumerable(Any) -> Enumerable(Any))
attach(p1 : Name, *, to p2 : Name, between sender : Name, and receiver : Name)
attach(p1 : Name, *, to p2 : Name, between sender : Coupleable, and receiver : Coupleable, &block : Enumerable(Any) -> Enumerable(Any))
attach(p1 : Name, *, to p2 : Name, between sender : Coupleable, and receiver : Coupleable)
attach(p1 : OutputPort, to p2 : OutputPort, &block : Enumerable(Any) -> Enumerable(Any))
attach(p1 : OutputPort, to p2 : OutputPort)
attach(p1 : OutputPort, to p2 : InputPort, &block : Enumerable(Any) -> Enumerable(Any))
attach(p1 : InputPort, to p2 : InputPort)
attach(p1 : InputPort, to p2 : InputPort, &block : Enumerable(Any) -> Enumerable(Any)) attach, attach_input(myport : Name, *, to iport : Name, of child : Coupleable)
attach_input(myport : Name, *, to iport : Name, of child : Coupleable, &block : Enumerable(Any) -> Enumerable(Any))
attach_input(myport : Name, *, to iport : Name, of child : Name)
attach_input(myport : Name, *, to iport : Name, of child : Name, &block : Enumerable(Any) -> Enumerable(Any)) attach_input, attach_output(oport : Name, *, of child : Name, to myport : Name, &block : Enumerable(Any) -> Enumerable(Any))
attach_output(oport : Name, *, of child : Coupleable, to myport : Name)
attach_output(oport : Name, *, of child : Name, to myport : Name)
attach_output(oport : Name, *, of child : Coupleable, to myport : Name, &block : Enumerable(Any) -> Enumerable(Any)) attach_output, children_names : Array(Name) children_names, children_size children_size, detach(p1 : InputPort, from p2 : InputPort) : Bool
detach(p1 : OutputPort, from p2 : InputPort) : Bool
detach(p1 : OutputPort, from p2 : OutputPort) : Bool
detach(oport : Name, *, from iport : Name, between sender : Coupleable, and receiver : Coupleable) : Bool
detach(oport : Name, *, from iport : Name, between sender : Name, and receiver : Name)
detach(oport : Name, *, of child : Coupleable, from myport : Name) : Bool
detach(oport : Name, *, of child : Name, from myport : Name) : Bool detach, each_child
each_child(&) each_child, each_coupling(&)
each_coupling(port : OutputPort, &)
each_coupling(port : InputPort, &) each_coupling, each_coupling_reverse(port : OutputPort, &)
each_coupling_reverse(port : InputPort, &) each_coupling_reverse, each_input_coupling(&)
each_input_coupling(port : InputPort, &) each_input_coupling, each_input_coupling_reverse(port : InputPort, &) each_input_coupling_reverse, each_internal_coupling(&)
each_internal_coupling(port : OutputPort, &) each_internal_coupling, each_internal_coupling_reverse(port : InputPort, &) each_internal_coupling_reverse, each_output_coupling(&)
each_output_coupling(port : OutputPort, &) each_output_coupling, each_output_coupling_reverse(port : OutputPort, &) each_output_coupling_reverse, find_direct_couplings(&block : OutputPort, InputPort, Array(Proc(Enumerable(Any), Enumerable(Any))) -> ) find_direct_couplings, has_child?(name : Name) : Bool
has_child?(model : Coupleable) : Bool has_child?, has_transducer_for?(src : Port, dst : Port) : Bool has_transducer_for?, input_couplings(port : InputPort) : Array(InputPort) input_couplings, internal_couplings(port : OutputPort) : Array(InputPort) internal_couplings, output_couplings(port : OutputPort) : Array(OutputPort) output_couplings, remove_child(model : Model) remove_child, transducer_for(src : Port, dst : Port) transducer_for
Instance methods inherited from module Quartz::Coupleable
add_input_port(name)
add_input_port,
add_output_port(name)
add_output_port,
add_port(port : InputPort)add_port(port : OutputPort) add_port, each_input_port(&) each_input_port, each_output_port(&) each_output_port, input_port(name : Name) : InputPort input_port, input_port?(name : Name) : InputPort? input_port?, input_port_list : Array(InputPort) input_port_list, input_port_names input_port_names, output_port(name : Name) : OutputPort output_port, output_port?(name : Name) : OutputPort? output_port?, output_port_list : Array(OutputPort) output_port_list, output_port_names output_port_names, remove_input_port(name) remove_input_port, remove_output_port(name) remove_output_port, remove_port(port : OutputPort)
remove_port(port : InputPort) remove_port
Instance methods inherited from class Quartz::Model
accept(visitor : Visitor)
accept,
accept_children(visitor)
accept_children,
after_initialize
after_initialize,
inspect(io)
inspect,
name : Name
name,
name=(name : Name)
name=,
processor : Processor?
processor,
processor=(processor : Processor?)
processor=,
processor? : Processor | Nil?
processor?,
to_s(io)
to_s
Constructor methods inherited from class Quartz::Model
new(name : Name)
new
Instance methods inherited from class Reference
==(other : Quartz::Any)
==
Instance methods inherited from class Object
===(other : Quartz::Any)
===
Class Method Detail
Instance Method Detail
Macro Detail
Defines the preferred event set for this particular class of coupled models. Specified event set will be used to coordinate childrens in all instances of this coupled model.
Writing:
class MyCoupled < CoupledModel
event_set ladder_queue
end
Is the same as writing:
class MyCoupled < CoupledModel
self.preferred_event_set = :ladder_queue
end
Or the same as:
class MyCoupled < CoupledModel; end
MyCoupled.preferred_event_set = :ladder_queue
The argument can be a string literal, a symbol literal or a plain name.
Defines default input ports for each of the given arguments. Those default input ports will be available in all instances, including instances of subclasses (meaning that ports are inherited).
Writing:
class MyModel < AtomicModel
input port_name
end
Is the same as writing:
class MyModel < AtomicModel
def initialize(name)
super(name)
add_input_port :port_name
end
end
The arguments can be string literals, symbol literals or plain names. However, they will be converted to symbol literals when the model is instantiated.
class MyModel < AtomicModel
input :in1, "in2", in3
end
Defines default output ports for each of the given arguments. Those default output ports will be available in all instances, including instances of subclasses (meaning that ports are inherited).
Writing:
class MyModel < AtomicModel
output port_name
end
Is the same as writing:
class MyModel < AtomicModel
def initialize(name)
super(name)
add_output_port :port_name
end
end
The arguments can be string literals, symbol literals or plain names. However, they will be converted to symbols literals when the model is instantiated.
class MyModel < AtomicModel
output :out1, "out2", out3
end