Class: Pione::PNML::FlowRuleBuilder
- Inherits:
-
Object
- Object
- Pione::PNML::FlowRuleBuilder
- Defined in:
- lib/pione/pnml/compiler.rb
Overview
FlowRuleBuilder builds a flow rule definition for PNML net.
Instance Method Summary collapse
-
#build(flow_elements, params, features, variable_bindings) ⇒ RuleDefinition
Build a flow rule definition for PNML net.
-
#initialize(net, net_name, env) ⇒ FlowRuleBuilder
constructor
A new instance of FlowRuleBuilder.
Constructor Details
#initialize(net, net_name, env) ⇒ FlowRuleBuilder
Returns a new instance of FlowRuleBuilder.
389 390 391 392 393 |
# File 'lib/pione/pnml/compiler.rb', line 389 def initialize(net, net_name, env) @net = net @net_name = net_name @env = env end |
Instance Method Details
#build(flow_elements, params, features, variable_bindings) ⇒ RuleDefinition
Build a flow rule definition for PNML net.
401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 |
# File 'lib/pione/pnml/compiler.rb', line 401 def build(flow_elements, params, features, variable_bindings) inputs = @net.places.select {|place| Perspective.net_input_data_place?(@env, place)} inputs = inputs.map {|input| InputData.new(input)} outputs = @net.places.select {|place| Perspective.net_output_data_place?(@env, place)} outputs = outputs.map {|output| OutputData.new(output)} option = { :inputs => inputs, :outputs => outputs, :params => params, :features => features, :variable_bindings => variable_bindings, :flow_elements => flow_elements } RuleDefinition.new(@net_name, :flow, false, @net_name, 0, option) end |