pione 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/.s3cfg +42 -0
- data/.travis.yml +18 -4
- data/.yardopts +1 -0
- data/Gemfile +3 -0
- data/History.txt +14 -0
- data/Procfile +7 -0
- data/Rakefile +25 -0
- data/bin/pione-interactive +6 -0
- data/bin/{pione-compiler → pione-notification-listener} +1 -1
- data/bin/{pione-broker → pione-task-worker-broker} +1 -1
- data/doc/man/pione-list-param.md +36 -0
- data/example/ActionError/ActionError.pione +9 -0
- data/example/ActionError/pione-package.json +15 -0
- data/example/CountChar/CountChar.pione +1 -1
- data/example/ScoreAggregation/ScoreAggregation.pione +1 -1
- data/example/Touch/pione-package.json +15 -0
- data/lib/pione.rb +12 -0
- data/lib/pione/agent.rb +3 -3
- data/lib/pione/agent/basic-agent.rb +10 -4
- data/lib/pione/agent/input-generator.rb +3 -3
- data/lib/pione/agent/{process-manager.rb → job-manager.rb} +10 -7
- data/lib/pione/agent/job-terminator.rb +2 -2
- data/lib/pione/agent/logger.rb +3 -3
- data/lib/pione/agent/messenger.rb +20 -9
- data/lib/pione/agent/notification-listener.rb +88 -0
- data/lib/pione/agent/task-worker-broker.rb +84 -0
- data/lib/pione/agent/task-worker.rb +3 -2
- data/lib/pione/agent/tuple-space-client.rb +1 -0
- data/lib/pione/agent/tuple-space-provider.rb +17 -35
- data/lib/pione/command.rb +33 -15
- data/lib/pione/command/action.rb +105 -0
- data/lib/pione/command/basic-command.rb +34 -376
- data/lib/pione/command/command-exception.rb +12 -11
- data/lib/pione/command/common.rb +198 -0
- data/lib/pione/command/option.rb +159 -204
- data/lib/pione/command/pione-action-exec.rb +85 -0
- data/lib/pione/command/pione-action-list.rb +43 -19
- data/lib/pione/command/pione-action-print.rb +79 -0
- data/lib/pione/command/pione-action.rb +8 -67
- data/lib/pione/command/pione-clean.rb +88 -68
- data/lib/pione/command/pione-client.rb +475 -332
- data/lib/pione/command/pione-command.rb +14 -31
- data/lib/pione/command/pione-compile.rb +90 -0
- data/lib/pione/command/pione-config-get.rb +53 -0
- data/lib/pione/command/pione-config-list.rb +64 -0
- data/lib/pione/command/pione-config-set.rb +59 -0
- data/lib/pione/command/pione-config-unset.rb +50 -0
- data/lib/pione/command/pione-config.rb +61 -0
- data/lib/pione/command/pione-diagnosis-notification.rb +235 -0
- data/lib/pione/command/pione-diagnosis.rb +21 -0
- data/lib/pione/command/pione-interactive.rb +188 -0
- data/lib/pione/command/pione-lang-check-syntax.rb +163 -0
- data/lib/pione/command/pione-lang-interactive.rb +146 -0
- data/lib/pione/command/pione-lang.rb +22 -0
- data/lib/pione/command/pione-log-format.rb +163 -0
- data/lib/pione/command/pione-log-list-id.rb +48 -0
- data/lib/pione/command/pione-log.rb +19 -101
- data/lib/pione/command/pione-notification-listener.rb +95 -0
- data/lib/pione/command/pione-package-add.rb +137 -0
- data/lib/pione/command/pione-package-build.rb +122 -0
- data/lib/pione/command/pione-package-show.rb +96 -0
- data/lib/pione/command/pione-package-update.rb +59 -0
- data/lib/pione/command/pione-package.rb +11 -139
- data/lib/pione/command/pione-task-worker-broker.rb +88 -0
- data/lib/pione/command/pione-task-worker.rb +148 -98
- data/lib/pione/command/pione-tuple-space-provider.rb +62 -54
- data/lib/pione/command/pione-tuple-space-viewer.rb +105 -83
- data/lib/pione/command/pione-val.rb +39 -39
- data/lib/pione/command/spawner.rb +34 -27
- data/lib/pione/front.rb +4 -2
- data/lib/pione/front/basic-front.rb +86 -23
- data/lib/pione/front/client-front.rb +2 -2
- data/lib/pione/front/diagnosis-notification-front.rb +40 -0
- data/lib/pione/front/front-exception.rb +7 -1
- data/lib/pione/front/notification-listener-front.rb +36 -0
- data/lib/pione/front/notification-recipient-interface.rb +19 -0
- data/lib/pione/front/relay-front.rb +4 -4
- data/lib/pione/front/task-worker-broker-front.rb +19 -0
- data/lib/pione/front/task-worker-front.rb +2 -2
- data/lib/pione/front/tuple-space-provider-front.rb +3 -2
- data/lib/pione/global.rb +3 -1
- data/lib/pione/global/client-variable.rb +1 -1
- data/lib/pione/global/config.rb +63 -7
- data/lib/pione/global/diagnosis-variable.rb +26 -0
- data/lib/pione/global/item.rb +28 -5
- data/lib/pione/global/log-variable.rb +6 -5
- data/lib/pione/global/network-variable.rb +75 -4
- data/lib/pione/global/path-variable.rb +1 -1
- data/lib/pione/global/system-variable.rb +12 -12
- data/lib/pione/global/task-worker-broker-variable.rb +43 -0
- data/lib/pione/global/tuple-space-notifier-variable.rb +3 -55
- data/lib/pione/lang/boolean.rb +4 -0
- data/lib/pione/lang/data-expr.rb +1 -1
- data/lib/pione/lang/integer.rb +1 -1
- data/lib/pione/lang/string.rb +4 -0
- data/lib/pione/lang/type.rb +1 -1
- data/lib/pione/location.rb +1 -0
- data/lib/pione/location/data-location.rb +41 -13
- data/lib/pione/location/dropbox-location.rb +175 -56
- data/lib/pione/location/ftp-location.rb +4 -1
- data/lib/pione/location/http-location.rb +5 -3
- data/lib/pione/location/https-location.rb +4 -2
- data/lib/pione/location/local-location.rb +6 -3
- data/lib/pione/location/location-exception.rb +12 -0
- data/lib/pione/location/notification-scheme.rb +46 -0
- data/lib/pione/log.rb +8 -7
- data/lib/pione/log/debug.rb +9 -9
- data/lib/pione/log/domain-log.rb +6 -1
- data/lib/pione/log/message-log-receiver.rb +32 -0
- data/lib/pione/log/system-log.rb +62 -141
- data/lib/pione/model.rb +7 -0
- data/lib/pione/model/notification-listener-model.rb +29 -0
- data/lib/pione/model/task-worker-broker-model.rb +129 -0
- data/lib/pione/notification.rb +13 -0
- data/lib/pione/notification/address.rb +104 -0
- data/lib/pione/notification/exception.rb +10 -0
- data/lib/pione/notification/message.rb +109 -0
- data/lib/pione/notification/receiver.rb +90 -0
- data/lib/pione/notification/recipient.rb +68 -0
- data/lib/pione/notification/task-worker-broker-recipient.rb +85 -0
- data/lib/pione/notification/transmitter.rb +84 -0
- data/lib/pione/pnml.rb +35 -0
- data/lib/pione/pnml/annotation-extractor.rb +47 -0
- data/lib/pione/pnml/compiler.rb +176 -0
- data/lib/pione/pnml/input-merge-complement.rb +78 -0
- data/lib/pione/pnml/input-parallelization-complement.rb +75 -0
- data/lib/pione/pnml/input-reduction.rb +80 -0
- data/lib/pione/pnml/invalid-arc-elimination.rb +41 -0
- data/lib/pione/pnml/io-expansion.rb +88 -0
- data/lib/pione/pnml/isolated-element-elimination.rb +32 -0
- data/lib/pione/pnml/net-rewriter.rb +44 -0
- data/lib/pione/pnml/output-decomposition-complement.rb +77 -0
- data/lib/pione/pnml/output-reduction.rb +86 -0
- data/lib/pione/pnml/output-synchronization-complement.rb +77 -0
- data/lib/pione/pnml/pione-model.rb +417 -0
- data/lib/pione/pnml/pnml-exception.rb +23 -0
- data/lib/pione/pnml/pnml-model.rb +368 -0
- data/lib/pione/pnml/reader.rb +51 -0
- data/lib/pione/rule-engine/action-handler.rb +8 -6
- data/lib/pione/rule-engine/basic-handler.rb +5 -5
- data/lib/pione/rule-engine/engine-exception.rb +7 -6
- data/lib/pione/rule-engine/flow-handler.rb +27 -18
- data/lib/pione/system.rb +3 -1
- data/lib/pione/system/domain-dump.rb +34 -0
- data/lib/pione/system/file-cache.rb +92 -13
- data/lib/pione/system/init.rb +3 -0
- data/lib/pione/system/normalizer.rb +40 -0
- data/lib/pione/system/status.rb +5 -5
- data/lib/pione/system/system-exception.rb +14 -1
- data/lib/pione/task-worker-broker.rb +7 -0
- data/lib/pione/task-worker-broker/basic-provider.rb +20 -0
- data/lib/pione/task-worker-broker/easy-provider.rb +65 -0
- data/lib/pione/test-helper.rb +27 -0
- data/lib/pione/test-helper/command-helper.rb +9 -101
- data/lib/pione/tuple-space/basic-tuple.rb +1 -1
- data/lib/pione/tuple-space/tuple-definition.yml +4 -6
- data/lib/pione/tuple-space/tuple-space-interface.rb +3 -45
- data/lib/pione/tuple-space/tuple-space-server.rb +45 -0
- data/lib/pione/util.rb +1 -2
- data/lib/pione/util/boolean-value.rb +62 -0
- data/lib/pione/util/completion.rb +111 -0
- data/lib/pione/util/evaluatable.rb +13 -27
- data/lib/pione/util/package-parameters-list.rb +15 -27
- data/lib/pione/util/zip.rb +8 -3
- data/lib/pione/version.rb +1 -1
- data/lib/rootage.rb +20 -0
- data/lib/rootage/action.rb +114 -0
- data/lib/rootage/argument.rb +46 -0
- data/lib/rootage/command.rb +218 -0
- data/lib/rootage/core.rb +532 -0
- data/lib/rootage/exception.rb +107 -0
- data/lib/rootage/help.rb +148 -0
- data/lib/rootage/help.txt.erb +31 -0
- data/lib/rootage/log.rb +226 -0
- data/lib/rootage/normalizer.rb +184 -0
- data/lib/rootage/option.rb +152 -0
- data/lib/rootage/scenario-test-result.erb +39 -0
- data/lib/rootage/scenario.rb +362 -0
- data/lib/rootage/test-helper.rb +115 -0
- data/man/pione-list-param.1 +44 -0
- data/misc/clock.rb +9 -0
- data/misc/machine-info.sh +21 -0
- data/misc/pione-completion.bash +238 -0
- data/misc/pione-completion.erb +53 -0
- data/misc/pione-completion.zsh +238 -0
- data/misc/pione.god +22 -0
- data/misc/ui.xml +23 -0
- data/pione.gemspec +3 -1
- data/test/agent/spec_basic-agent.rb +1 -1
- data/test/agent/spec_input-generator.rb +2 -2
- data/test/agent/spec_messenger.rb +6 -9
- data/test/agent/spec_notification-listener.rb +80 -0
- data/test/agent/{spec_broker.rb → spec_task-worker-broker.rb} +13 -10
- data/test/agent/spec_tuple-space-provider.rb +10 -6
- data/test/command/command-behavior.rb +3 -11
- data/test/command/data/pione-list-param/AdvancedParameters.pione +12 -0
- data/test/command/data/pione-list-param/BasicParameters.pione +12 -0
- data/test/command/spec_pione-action-exec.rb +16 -0
- data/test/command/spec_pione-action-list.rb +15 -10
- data/test/command/spec_pione-action-print.rb +14 -0
- data/test/command/spec_pione-action.rb +6 -19
- data/test/command/spec_pione-clean.rb +29 -46
- data/test/command/spec_pione-client.rb +29 -36
- data/test/command/spec_pione-command.rb +6 -6
- data/test/command/{spec_pione-compiler.rb → spec_pione-compile.rb} +11 -13
- data/test/command/spec_pione-config-get.rb +47 -0
- data/test/command/spec_pione-config-list.rb +42 -0
- data/test/command/spec_pione-config-set.rb +38 -0
- data/test/command/spec_pione-config-unset.rb +44 -0
- data/test/command/spec_pione-config.rb +11 -0
- data/test/command/spec_pione-diagnosis-notification.rb +23 -0
- data/test/command/spec_pione-diagnosis.rb +11 -0
- data/test/command/spec_pione-lang-check-syntax.rb +12 -0
- data/test/command/spec_pione-lang.rb +11 -0
- data/test/command/spec_pione-log-format.rb +29 -0
- data/test/command/spec_pione-log-list-id.rb +17 -0
- data/test/command/spec_pione-log.rb +6 -20
- data/test/command/spec_pione-package-add.rb +55 -0
- data/test/command/spec_pione-package-build.rb +57 -0
- data/test/command/spec_pione-package-show.rb +72 -0
- data/test/command/{spec_pione-update-package-info.rb → spec_pione-package-update.rb} +12 -13
- data/test/command/spec_pione-package.rb +4 -104
- data/test/command/spec_pione-val.rb +10 -7
- data/test/global/spec_config.rb +50 -0
- data/test/global/spec_item.rb +1 -1
- data/test/literate-action/data/HelloWorld.md +1 -1
- data/test/location/location-behavior.rb +1 -1
- data/test/location/spec_dropbox-location.rb +39 -0
- data/test/location/spec_notification-scheme.rb +37 -0
- data/test/log/spec_debug.rb +5 -4
- data/test/log/spec_message-log-receiver.rb +13 -0
- data/test/log/spec_message-log.rb +6 -9
- data/test/log/spec_system-log.rb +5 -3
- data/test/notification/spec_address.rb +229 -0
- data/test/notification/spec_message.rb +30 -0
- data/test/notification/spec_receiver.rb +36 -0
- data/test/notification/spec_transmitter.rb +37 -0
- data/test/pnml/data/ConditionalBranchIf.pnml +270 -0
- data/test/pnml/data/ConditionalBranchIfElse.pnml +309 -0
- data/test/pnml/data/IOExpansionComplex.pnml +363 -0
- data/test/pnml/data/IOExpansionSimple.pnml +140 -0
- data/test/pnml/data/InputMergeComplementComplex.pnml +381 -0
- data/test/pnml/data/InputMergeComplementSimple.pnml +248 -0
- data/test/pnml/data/InputParallelizationComplementComplex.pnml +433 -0
- data/test/pnml/data/InputParallelizationComplementSimple.pnml +288 -0
- data/test/pnml/data/InputReductionComplex.pnml +192 -0
- data/test/pnml/data/InputReductionLong.pnml +344 -0
- data/test/pnml/data/InputReductionSimple.pnml +140 -0
- data/test/pnml/data/IsolatedElementElimination.pnml +171 -0
- data/test/pnml/data/OutputDecompositionComplementComplex.pnml +381 -0
- data/test/pnml/data/OutputDecompositionComplementSimple.pnml +242 -0
- data/test/pnml/data/OutputReductionComplex.pnml +186 -0
- data/test/pnml/data/OutputReductionLong.pnml +344 -0
- data/test/pnml/data/OutputReductionSimple.pnml +140 -0
- data/test/pnml/data/OutputSynchronizationComplementComplex.pnml +498 -0
- data/test/pnml/data/OutputSynchronizationComplementSimple.pnml +347 -0
- data/test/pnml/data/SampleNet.pnml +238 -0
- data/test/pnml/spec_input-merge-complement.rb +40 -0
- data/test/pnml/spec_input-parallelization-complement.rb +50 -0
- data/test/pnml/spec_input-reduction.rb +113 -0
- data/test/pnml/spec_invalid-arc-elimination.rb +33 -0
- data/test/pnml/spec_io-expansion.rb +126 -0
- data/test/pnml/spec_isolated-element-elimination.rb +25 -0
- data/test/pnml/spec_output-decomposition-complement.rb +40 -0
- data/test/pnml/spec_output-reduction.rb +114 -0
- data/test/pnml/spec_output-synchronization-complement.rb +62 -0
- data/test/pnml/spec_pione-element.rb +144 -0
- data/test/pnml/spec_pnml-element.rb +373 -0
- data/test/pnml/spec_reader.rb +16 -0
- data/test/rootage/spec_argument.rb +18 -0
- data/test/rootage/spec_command.rb +239 -0
- data/test/rootage/spec_core.rb +198 -0
- data/test/rootage/spec_scenario.rb +149 -0
- data/test/system/{spec_domain-info.rb → spec_domain-dump.rb} +6 -6
- data/test/system/spec_file-cache.rb +6 -9
- data/test/tuple-space/spec_finished-tuple.rb +1 -1
- data/test/util/{spec_package-parameters-list_1.pione → data/package-parameters-list/Param1.pione} +0 -0
- data/test/util/{spec_package-parameters-list_2.pione → data/package-parameters-list/Param2.pione} +0 -0
- data/test/util/{spec_package-parameters-list_3.pione → data/package-parameters-list/Param3.pione} +0 -0
- data/test/util/{spec_package-parameters-list_4.pione → data/package-parameters-list/Param4.pione} +0 -0
- data/test/util/spec_boolean-value.rb +32 -0
- data/test/util/spec_completion.rb +22 -0
- data/test/util/spec_package-parameters-list.rb +39 -52
- data/test/util/spec_zip.rb +28 -1
- metadata +288 -47
- data/bin/pione-tuple-space-receiver +0 -5
- data/lib/pione/agent/broker.rb +0 -304
- data/lib/pione/agent/tuple-space-receiver.rb +0 -137
- data/lib/pione/command/pione-broker.rb +0 -104
- data/lib/pione/command/pione-compiler.rb +0 -57
- data/lib/pione/command/pione-relay-account-db.rb +0 -141
- data/lib/pione/command/pione-relay-client-db.rb +0 -118
- data/lib/pione/command/pione-relay.rb +0 -59
- data/lib/pione/command/pione-syntax-checker.rb +0 -214
- data/lib/pione/command/pione-tuple-space-receiver.rb +0 -111
- data/lib/pione/command/pione-update-package-info.rb +0 -53
- data/lib/pione/front/broker-front.rb +0 -22
- data/lib/pione/front/tuple-space-receiver-front.rb +0 -11
- data/lib/pione/global/broker-variable.rb +0 -33
- data/lib/pione/system/domain-info.rb +0 -25
- data/lib/pione/util/pnml-compiler.rb +0 -168
- data/test/agent/spec_tuple-space-receiver.rb +0 -47
- data/test/util/spec_pnml-compiler.rb +0 -32
@@ -0,0 +1,62 @@
|
|
1
|
+
require 'pione/test-helper'
|
2
|
+
|
3
|
+
TestHelper.scope do |this|
|
4
|
+
this::DIR = Location[__FILE__].dirname + "data"
|
5
|
+
this::SIMPLE = this::DIR + "OutputSynchronizationComplementSimple.pnml"
|
6
|
+
this::COMPLEX = this::DIR + "OutputSynchronizationComplementComplex.pnml"
|
7
|
+
|
8
|
+
describe Pione::PNML::OutputSynchronizationComplement do
|
9
|
+
it "should name source place in simple case" do
|
10
|
+
net = PNML::Reader.read(this::SIMPLE)
|
11
|
+
|
12
|
+
# elements
|
13
|
+
transition_A = net.find_transition_by_name("A")
|
14
|
+
transition_B = net.find_transition_by_name("B")
|
15
|
+
transition_C = net.find_transition_by_name("C")
|
16
|
+
place_RA = net.find_all_places_by_source_id(transition_A.id).first
|
17
|
+
place_RB = net.find_all_places_by_source_id(transition_B.id).first
|
18
|
+
place_RC = net.find_all_places_by_source_id(transition_C.id).first
|
19
|
+
|
20
|
+
# apply "output synchronization complement" rule
|
21
|
+
PNML::NetRewriter.new{|rules| rules << PNML::OutputSynchronizationComplement}.rewrite(net)
|
22
|
+
|
23
|
+
# test
|
24
|
+
place_RA.name.should == "'*.p1'"
|
25
|
+
place_RB.name.should == "'*.p1'"
|
26
|
+
place_RC.name.should == "'*.p1'"
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should name source place in complex case" do
|
30
|
+
net = PNML::Reader.read(this::COMPLEX)
|
31
|
+
|
32
|
+
# elements
|
33
|
+
transition_A = net.find_transition_by_name("A")
|
34
|
+
transition_B = net.find_transition_by_name("B")
|
35
|
+
transition_C = net.find_transition_by_name("C")
|
36
|
+
places_RA = net.find_all_places_by_source_id(transition_A.id)
|
37
|
+
places_RB = net.find_all_places_by_source_id(transition_B.id)
|
38
|
+
places_RC = net.find_all_places_by_source_id(transition_C.id)
|
39
|
+
place_p1 = net.find_place_by_name("'*.p1'")
|
40
|
+
place_p2 = net.find_place_by_name("'*.p2'")
|
41
|
+
transition_Lp1 = net.find_transition_by_target_id(place_p1.id)
|
42
|
+
transition_Lp2 = net.find_transition_by_target_id(place_p2.id)
|
43
|
+
place_RA_p1 = places_RA.find {|place| net.find_arc(place.id, transition_Lp1.id)}
|
44
|
+
place_RA_p2 = places_RA.find {|place| net.find_arc(place.id, transition_Lp2.id)}
|
45
|
+
place_RB_p1 = places_RB.find {|place| net.find_arc(place.id, transition_Lp1.id)}
|
46
|
+
place_RB_p2 = places_RB.find {|place| net.find_arc(place.id, transition_Lp2.id)}
|
47
|
+
place_RC_p1 = places_RC.find {|place| net.find_arc(place.id, transition_Lp1.id)}
|
48
|
+
place_RC_p2 = places_RC.find {|place| net.find_arc(place.id, transition_Lp2.id)}
|
49
|
+
|
50
|
+
# apply "output synchronization complement" rule
|
51
|
+
PNML::NetRewriter.new{|rules| rules << PNML::OutputSynchronizationComplement}.rewrite(net)
|
52
|
+
|
53
|
+
# test
|
54
|
+
place_RA_p1.name.should == "'*.p1'"
|
55
|
+
place_RA_p2.name.should == "'*.p2'"
|
56
|
+
place_RB_p1.name.should == "'*.p1'"
|
57
|
+
place_RB_p2.name.should == "'*.p2'"
|
58
|
+
place_RC_p1.name.should == "'*.p1'"
|
59
|
+
place_RC_p2.name.should == "'*.p2'"
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,144 @@
|
|
1
|
+
require 'pione/test-helper'
|
2
|
+
|
3
|
+
describe Pione::PNML::ConstituentRule do
|
4
|
+
it "should get declaration string" do
|
5
|
+
PNML::ConstituentRule.new(:action, "R").tap do |rule|
|
6
|
+
rule.as_declaration.should == "rule R"
|
7
|
+
end
|
8
|
+
|
9
|
+
PNML::ConstituentRule.new(:flow, "R").tap do |rule|
|
10
|
+
rule.as_declaration.should == "rule R"
|
11
|
+
end
|
12
|
+
|
13
|
+
PNML::ConstituentRule.new(:action, "$P.rule(R)").tap do |rule|
|
14
|
+
rule.as_declaration.should == "rule $P.rule(R)"
|
15
|
+
end
|
16
|
+
|
17
|
+
PNML::ConstituentRule.new(:action, "R").tap do |rule|
|
18
|
+
rule.params << PNML::Param.new("x", "1")
|
19
|
+
rule.as_declaration.should == "rule R {x: $x}"
|
20
|
+
end
|
21
|
+
|
22
|
+
PNML::ConstituentRule.new(:action, "R").tap do |rule|
|
23
|
+
rule.params << PNML::Param.new("x", "1")
|
24
|
+
rule.params << PNML::Param.new("y", '"abc"')
|
25
|
+
rule.as_declaration.should == 'rule R {x: $x, y: $y}'
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe Pione::PNML::DataCondition do
|
31
|
+
it "should get input declaration string" do
|
32
|
+
PNML::DataCondition.new("'a.txt'").tap do |cond|
|
33
|
+
cond.as_input_declaration.should == "input 'a.txt'"
|
34
|
+
end
|
35
|
+
|
36
|
+
PNML::DataCondition.new("'a.txt' | 'b.txt' | 'c.txt'").tap do |cond|
|
37
|
+
cond.as_input_declaration.should == "input 'a.txt' | 'b.txt' | 'c.txt'"
|
38
|
+
end
|
39
|
+
|
40
|
+
PNML::DataCondition.new("'a.txt'").tap do |cond|
|
41
|
+
cond.input_nonexistable = true
|
42
|
+
cond.as_input_declaration.should == "input 'a.txt' or null"
|
43
|
+
end
|
44
|
+
|
45
|
+
PNML::DataCondition.new("'*.txt'").tap do |cond|
|
46
|
+
cond.as_input_declaration.should == "input '*.txt'"
|
47
|
+
end
|
48
|
+
|
49
|
+
PNML::DataCondition.new("'a.txt'").tap do |cond|
|
50
|
+
cond.input_distribution = :all
|
51
|
+
cond.as_input_declaration.should == "input ('a.txt').all"
|
52
|
+
end
|
53
|
+
|
54
|
+
PNML::DataCondition.new("'a.txt'").tap do |cond|
|
55
|
+
cond.input_priority = 100
|
56
|
+
cond.as_input_declaration.should == "input 'a.txt'"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should get output declaration string" do
|
61
|
+
PNML::DataCondition.new("'a.txt'").tap do |cond|
|
62
|
+
cond.as_output_declaration.should == "output 'a.txt'"
|
63
|
+
end
|
64
|
+
|
65
|
+
PNML::DataCondition.new("'*.txt'").tap do |cond|
|
66
|
+
cond.as_output_declaration.should == "output '*.txt'"
|
67
|
+
end
|
68
|
+
|
69
|
+
PNML::DataCondition.new("'a.txt' | 'b.txt' | 'c.txt'").tap do |cond|
|
70
|
+
cond.as_output_declaration.should == "output 'a.txt' | 'b.txt' | 'c.txt'"
|
71
|
+
end
|
72
|
+
|
73
|
+
PNML::DataCondition.new("'a.txt'").tap do |cond|
|
74
|
+
cond.output_nonexistable = true
|
75
|
+
cond.as_output_declaration.should == "output 'a.txt' or null"
|
76
|
+
end
|
77
|
+
|
78
|
+
PNML::DataCondition.new("'a.txt'").tap do |cond|
|
79
|
+
cond.output_distribution = :all
|
80
|
+
cond.as_output_declaration.should == "output ('a.txt').all"
|
81
|
+
end
|
82
|
+
|
83
|
+
PNML::DataCondition.new("'a.txt'").tap do |cond|
|
84
|
+
cond.output_priority = 100
|
85
|
+
cond.as_output_declaration.should == "output 'a.txt'"
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
describe Pione::PNML::Param do
|
91
|
+
it "should get declaration string" do
|
92
|
+
PNML::Param.new("x", "1").tap do |param|
|
93
|
+
param.as_declaration.should == "param $x := 1"
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
describe Pione::PNML::ConditionalBranch do
|
99
|
+
it "should get declaration string" do
|
100
|
+
PNML::ConditionalBranch.new(:case, "$x").tap do |cb|
|
101
|
+
cb.table["true"] << PNML::ConstituentRule.new(:action, "R1")
|
102
|
+
cb.table["false"] << PNML::ConstituentRule.new(:action, "R2")
|
103
|
+
cb.as_declaration.should == Util::Indentation.cut(<<-PIONE)
|
104
|
+
case $x
|
105
|
+
when true
|
106
|
+
rule R1
|
107
|
+
when false
|
108
|
+
rule R2
|
109
|
+
end
|
110
|
+
PIONE
|
111
|
+
end
|
112
|
+
|
113
|
+
PNML::ConditionalBranch.new(:case, "$x").tap do |cb|
|
114
|
+
cb.table["true"] << PNML::ConstituentRule.new(:action, "R1")
|
115
|
+
cb.table["true"] << PNML::ConstituentRule.new(:action, "R2")
|
116
|
+
cb.table["true"] << PNML::ConstituentRule.new(:action, "R3")
|
117
|
+
cb.table["false"] << PNML::ConstituentRule.new(:action, "R4")
|
118
|
+
cb.table["false"] << PNML::ConstituentRule.new(:action, "R5")
|
119
|
+
cb.table["false"] << PNML::ConstituentRule.new(:action, "R6")
|
120
|
+
cb.as_declaration.should == Util::Indentation.cut(<<-PIONE)
|
121
|
+
case $x
|
122
|
+
when true
|
123
|
+
rule R1
|
124
|
+
rule R2
|
125
|
+
rule R3
|
126
|
+
when false
|
127
|
+
rule R4
|
128
|
+
rule R5
|
129
|
+
rule R6
|
130
|
+
end
|
131
|
+
PIONE
|
132
|
+
end
|
133
|
+
|
134
|
+
PNML::ConditionalBranch.new(:case, "$x").tap do |cb|
|
135
|
+
cb.table["true"] << PNML::ConstituentRule.new(:action, "R1")
|
136
|
+
cb.as_declaration.should == Util::Indentation.cut(<<-PIONE)
|
137
|
+
case $x
|
138
|
+
when true
|
139
|
+
rule R1
|
140
|
+
end
|
141
|
+
PIONE
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
@@ -0,0 +1,373 @@
|
|
1
|
+
require 'pione/test-helper'
|
2
|
+
|
3
|
+
TestHelper.scope do |this|
|
4
|
+
this::SAMPLE_NET = Location[__FILE__].dirname + "data" + "SampleNet.pnml"
|
5
|
+
|
6
|
+
describe Pione::PNML::Net do
|
7
|
+
before do
|
8
|
+
@net = PNML::Reader.read(this::SAMPLE_NET)
|
9
|
+
@transition_A = @net.find_transition_by_name("A")
|
10
|
+
@transition_B = @net.find_transition_by_name("B")
|
11
|
+
@place_i1 = @net.find_place_by_name("<'i1'")
|
12
|
+
@place_i2 = @net.find_place_by_name("<'i2'")
|
13
|
+
@place_i3 = @net.find_place_by_name("<'i3'")
|
14
|
+
@place_p1 = @net.find_place_by_name("'p1'")
|
15
|
+
@place_o1 = @net.find_place_by_name(">'o1'")
|
16
|
+
@place_o2 = @net.find_place_by_name(">'o2'")
|
17
|
+
@place_o3 = @net.find_place_by_name(">'o3'")
|
18
|
+
@arc_i1_A = @net.find_arc(@place_i1.id, @transition_A.id)
|
19
|
+
@arc_i2_A = @net.find_arc(@place_i2.id, @transition_A.id)
|
20
|
+
@arc_i3_A = @net.find_arc(@place_i3.id, @transition_A.id)
|
21
|
+
@arc_A_p1 = @net.find_arc(@transition_A.id, @place_p1.id)
|
22
|
+
@arc_p1_B = @net.find_arc(@place_p1.id, @transition_B.id)
|
23
|
+
@arc_B_o1 = @net.find_arc(@transition_B.id, @place_o1.id)
|
24
|
+
@arc_B_o2 = @net.find_arc(@transition_B.id, @place_o2.id)
|
25
|
+
@arc_B_o3 = @net.find_arc(@transition_B.id, @place_o3.id)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should have palces" do
|
29
|
+
@net.places.size.should == 7
|
30
|
+
@net.places.each {|place| place.should.kind_of PNML::Place}
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should have transitions" do
|
34
|
+
@net.transitions.size.should == 2
|
35
|
+
@net.transitions.each {|transition| transition.should.kind_of PNML::Transition}
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should have arcs" do
|
39
|
+
@net.arcs.size.should == 8
|
40
|
+
@net.arcs.each {|arc| arc.should.kind_of PNML::Arc}
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should generate a new ID" do
|
44
|
+
ids = (@net.places + @net.transitions + @net.arcs).map {|elt| elt.id}
|
45
|
+
ids.should.not.include @net.generate_id
|
46
|
+
end
|
47
|
+
|
48
|
+
it "should find an arc by source ID and target ID" do
|
49
|
+
arc = @net.arcs.first
|
50
|
+
@net.find_arc(arc.source_id, arc.target_id).should == arc
|
51
|
+
@net.find_arc(Util::UUID.generate, Util::UUID.generate).should.nil
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should find all arcs by source ID" do
|
55
|
+
@net.find_all_arcs_by_source_id(@place_i1.id).tap do |arcs|
|
56
|
+
arcs.size.should == 1
|
57
|
+
arcs.should.include @arc_i1_A
|
58
|
+
end
|
59
|
+
|
60
|
+
@net.find_all_arcs_by_source_id(@place_i2.id).tap do |arcs|
|
61
|
+
arcs.size.should == 1
|
62
|
+
arcs.should.include @arc_i2_A
|
63
|
+
end
|
64
|
+
|
65
|
+
@net.find_all_arcs_by_source_id(@place_i3.id).tap do |arcs|
|
66
|
+
arcs.size.should == 1
|
67
|
+
arcs.should.include @arc_i3_A
|
68
|
+
end
|
69
|
+
|
70
|
+
@net.find_all_arcs_by_source_id(@transition_A.id).tap do |arcs|
|
71
|
+
arcs.size.should == 1
|
72
|
+
arcs.should.include @arc_A_p1
|
73
|
+
end
|
74
|
+
|
75
|
+
@net.find_all_arcs_by_source_id(@place_p1.id).tap do |arcs|
|
76
|
+
arcs.size.should == 1
|
77
|
+
arcs.should.include @arc_p1_B
|
78
|
+
end
|
79
|
+
|
80
|
+
@net.find_all_arcs_by_source_id(@transition_B.id).tap do |arcs|
|
81
|
+
arcs.size.should == 3
|
82
|
+
arcs.should.include @arc_B_o1
|
83
|
+
arcs.should.include @arc_B_o2
|
84
|
+
arcs.should.include @arc_B_o3
|
85
|
+
end
|
86
|
+
|
87
|
+
@net.find_all_arcs_by_source_id(@place_o1.id).size.should == 0
|
88
|
+
@net.find_all_arcs_by_source_id(@place_o2.id).size.should == 0
|
89
|
+
@net.find_all_arcs_by_source_id(@place_o3.id).size.should == 0
|
90
|
+
end
|
91
|
+
|
92
|
+
it "should find all arcs by target ID" do
|
93
|
+
@net.find_all_arcs_by_target_id(@place_i1.id).size.should == 0
|
94
|
+
@net.find_all_arcs_by_target_id(@place_i2.id).size.should == 0
|
95
|
+
@net.find_all_arcs_by_target_id(@place_i3.id).size.should == 0
|
96
|
+
|
97
|
+
@net.find_all_arcs_by_target_id(@transition_A.id).tap do |arcs|
|
98
|
+
arcs.size.should == 3
|
99
|
+
arcs.should.include @arc_i1_A
|
100
|
+
arcs.should.include @arc_i2_A
|
101
|
+
arcs.should.include @arc_i3_A
|
102
|
+
end
|
103
|
+
|
104
|
+
@net.find_all_arcs_by_target_id(@place_p1.id).tap do |arcs|
|
105
|
+
arcs.size.should == 1
|
106
|
+
arcs.should.include @arc_A_p1
|
107
|
+
end
|
108
|
+
|
109
|
+
@net.find_all_arcs_by_target_id(@transition_B.id).tap do |arcs|
|
110
|
+
arcs.size.should == 1
|
111
|
+
arcs.should.include @arc_p1_B
|
112
|
+
end
|
113
|
+
|
114
|
+
@net.find_all_arcs_by_target_id(@place_o1.id).tap do |arcs|
|
115
|
+
arcs.size.should == 1
|
116
|
+
arcs.should.include @arc_B_o1
|
117
|
+
end
|
118
|
+
|
119
|
+
@net.find_all_arcs_by_target_id(@place_o2.id).tap do |arcs|
|
120
|
+
arcs.size.should == 1
|
121
|
+
arcs.should.include @arc_B_o2
|
122
|
+
end
|
123
|
+
|
124
|
+
@net.find_all_arcs_by_target_id(@place_o3.id).tap do |arcs|
|
125
|
+
arcs.size.should == 1
|
126
|
+
arcs.should.include @arc_B_o3
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
it "should get arcs from transtion to place" do
|
131
|
+
@net.tp_arcs.tap do |arcs|
|
132
|
+
arcs.size.should == 4
|
133
|
+
arcs.should.include @arc_A_p1
|
134
|
+
arcs.should.include @arc_B_o1
|
135
|
+
arcs.should.include @arc_B_o2
|
136
|
+
arcs.should.include @arc_B_o3
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
it "should get arcs from place to transtion" do
|
141
|
+
@net.pt_arcs.tap do |arcs|
|
142
|
+
arcs.size.should == 4
|
143
|
+
arcs.should.include @arc_i1_A
|
144
|
+
arcs.should.include @arc_i2_A
|
145
|
+
arcs.should.include @arc_i3_A
|
146
|
+
arcs.should.include @arc_p1_B
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
it "should find a transition by ID" do
|
151
|
+
@net.find_transition(@transition_A.id).should == @transition_A
|
152
|
+
@net.find_transition(@transition_B.id).should == @transition_B
|
153
|
+
@net.find_transition(Util::UUID.generate).should.nil
|
154
|
+
end
|
155
|
+
|
156
|
+
it "should find a transition by name" do
|
157
|
+
@net.find_transition_by_name("A").should == @transition_A
|
158
|
+
@net.find_transition_by_name("B").should == @transition_B
|
159
|
+
@net.find_transition_by_name("C").should.nil
|
160
|
+
end
|
161
|
+
|
162
|
+
it "should find all transitions by name" do
|
163
|
+
@net.find_all_transitions_by_name("A").should == [@transition_A]
|
164
|
+
@net.find_all_transitions_by_name("B").should == [@transition_B]
|
165
|
+
@net.find_all_transitions_by_name("C").should.empty
|
166
|
+
end
|
167
|
+
|
168
|
+
it "should find all tarnsitions by source ID" do
|
169
|
+
@net.find_all_transitions_by_source_id(@place_i1.id).tap do |transitions|
|
170
|
+
transitions.size.should == 1
|
171
|
+
transitions.should.include @transition_A
|
172
|
+
end
|
173
|
+
|
174
|
+
@net.find_all_transitions_by_source_id(@place_i2.id).tap do |transitions|
|
175
|
+
transitions.size.should == 1
|
176
|
+
transitions.should.include @transition_A
|
177
|
+
end
|
178
|
+
|
179
|
+
@net.find_all_transitions_by_source_id(@place_i3.id).tap do |transitions|
|
180
|
+
transitions.size.should == 1
|
181
|
+
transitions.should.include @transition_A
|
182
|
+
end
|
183
|
+
|
184
|
+
@net.find_all_transitions_by_source_id(@place_p1.id).tap do |transitions|
|
185
|
+
transitions.size.should == 1
|
186
|
+
transitions.should.include @transition_B
|
187
|
+
end
|
188
|
+
|
189
|
+
@net.find_all_transitions_by_source_id(@place_o1.id).should.empty
|
190
|
+
@net.find_all_transitions_by_source_id(@place_o2.id).should.empty
|
191
|
+
@net.find_all_transitions_by_source_id(@place_o3.id).should.empty
|
192
|
+
end
|
193
|
+
|
194
|
+
it "should find all transitions by target ID" do
|
195
|
+
@net.find_all_transitions_by_target_id(@place_i1.id).should.empty
|
196
|
+
@net.find_all_transitions_by_target_id(@place_i2.id).should.empty
|
197
|
+
@net.find_all_transitions_by_target_id(@place_i3.id).should.empty
|
198
|
+
|
199
|
+
@net.find_all_transitions_by_target_id(@place_p1.id).tap do |transitions|
|
200
|
+
transitions.size.should == 1
|
201
|
+
transitions.should.include @transition_A
|
202
|
+
end
|
203
|
+
|
204
|
+
@net.find_all_transitions_by_target_id(@place_o1.id).tap do |transitions|
|
205
|
+
transitions.size.should == 1
|
206
|
+
transitions.should.include @transition_B
|
207
|
+
end
|
208
|
+
|
209
|
+
@net.find_all_transitions_by_target_id(@place_o2.id).tap do |transitions|
|
210
|
+
transitions.size.should == 1
|
211
|
+
transitions.should.include @transition_B
|
212
|
+
end
|
213
|
+
|
214
|
+
@net.find_all_transitions_by_target_id(@place_o3.id).tap do |transitions|
|
215
|
+
transitions.size.should == 1
|
216
|
+
transitions.should.include @transition_B
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
it "should find a place by ID" do
|
221
|
+
@net.find_place(@place_i1.id).should == @place_i1
|
222
|
+
@net.find_place(@place_i2.id).should == @place_i2
|
223
|
+
@net.find_place(@place_i3.id).should == @place_i3
|
224
|
+
@net.find_place(@place_p1.id).should == @place_p1
|
225
|
+
@net.find_place(@place_o1.id).should == @place_o1
|
226
|
+
@net.find_place(@place_o2.id).should == @place_o2
|
227
|
+
@net.find_place(@place_o3.id).should == @place_o3
|
228
|
+
end
|
229
|
+
|
230
|
+
it "should find a place by name" do
|
231
|
+
@net.find_place_by_name("<'i1'").should == @place_i1
|
232
|
+
@net.find_place_by_name("<'i2'").should == @place_i2
|
233
|
+
@net.find_place_by_name("<'i3'").should == @place_i3
|
234
|
+
@net.find_place_by_name("'p1'").should == @place_p1
|
235
|
+
@net.find_place_by_name(">'o1'").should == @place_o1
|
236
|
+
@net.find_place_by_name(">'o2'").should == @place_o2
|
237
|
+
@net.find_place_by_name(">'o3'").should == @place_o3
|
238
|
+
@net.find_place_by_name(Util::UUID.generate).should.nil
|
239
|
+
end
|
240
|
+
|
241
|
+
it "should find all places by name" do
|
242
|
+
@net.find_all_places_by_name("<'i1'").tap do |places|
|
243
|
+
places.size.should == 1
|
244
|
+
places.should.include @place_i1
|
245
|
+
end
|
246
|
+
|
247
|
+
@net.find_all_places_by_name("<'i2'").tap do |places|
|
248
|
+
places.size.should == 1
|
249
|
+
places.should.include @place_i2
|
250
|
+
end
|
251
|
+
|
252
|
+
@net.find_all_places_by_name("<'i3'").tap do |places|
|
253
|
+
places.size.should == 1
|
254
|
+
places.should.include @place_i3
|
255
|
+
end
|
256
|
+
|
257
|
+
@net.find_all_places_by_name("'p1'").tap do |places|
|
258
|
+
places.size.should == 1
|
259
|
+
places.should.include @place_p1
|
260
|
+
end
|
261
|
+
|
262
|
+
@net.find_all_places_by_name(">'o1'").tap do |places|
|
263
|
+
places.size.should == 1
|
264
|
+
places.should.include @place_o1
|
265
|
+
end
|
266
|
+
|
267
|
+
@net.find_all_places_by_name(">'o2'").tap do |places|
|
268
|
+
places.size.should == 1
|
269
|
+
places.should.include @place_o2
|
270
|
+
end
|
271
|
+
|
272
|
+
@net.find_all_places_by_name(">'o3'").tap do |places|
|
273
|
+
places.size.should == 1
|
274
|
+
places.should.include @place_o3
|
275
|
+
end
|
276
|
+
|
277
|
+
@net.find_all_places_by_name(Util::UUID.generate).should.empty
|
278
|
+
end
|
279
|
+
|
280
|
+
it "should all places by source transition ID" do
|
281
|
+
@net.find_all_places_by_source_id(@transition_A.id).tap do |places|
|
282
|
+
places.size.should == 1
|
283
|
+
places.should.include @place_p1
|
284
|
+
end
|
285
|
+
|
286
|
+
@net.find_all_places_by_source_id(@transition_B.id).tap do |places|
|
287
|
+
places.size.should == 3
|
288
|
+
places.should.include @place_o1
|
289
|
+
places.should.include @place_o2
|
290
|
+
places.should.include @place_o3
|
291
|
+
end
|
292
|
+
end
|
293
|
+
|
294
|
+
it "should all places by target transition ID" do
|
295
|
+
@net.find_all_places_by_target_id(@transition_A.id).tap do |places|
|
296
|
+
places.size.should == 3
|
297
|
+
places.should.include @place_i1
|
298
|
+
places.should.include @place_i2
|
299
|
+
places.should.include @place_i3
|
300
|
+
end
|
301
|
+
|
302
|
+
@net.find_all_places_by_target_id(@transition_B.id).tap do |places|
|
303
|
+
places.size.should == 1
|
304
|
+
places.should.include @place_p1
|
305
|
+
end
|
306
|
+
end
|
307
|
+
end
|
308
|
+
end
|
309
|
+
|
310
|
+
describe Pione::PNML::Place do
|
311
|
+
it "should distinguish empty names" do
|
312
|
+
PNML::Place.new(PNML::Net.new, Util::UUID.generate, "a").should.not.empty_name
|
313
|
+
PNML::Place.new(PNML::Net.new, Util::UUID.generate, "").should.empty_name
|
314
|
+
PNML::Place.new(PNML::Net.new, Util::UUID.generate, " ").should.empty_name
|
315
|
+
PNML::Place.new(PNML::Net.new, Util::UUID.generate, " #abc").should.empty_name
|
316
|
+
end
|
317
|
+
end
|
318
|
+
|
319
|
+
describe Pione::PNML::Transition do
|
320
|
+
it "should distinguish empty names" do
|
321
|
+
PNML::Transition.new(PNML::Net.new, Util::UUID.generate, "a").should.not.empty_name
|
322
|
+
PNML::Transition.new(PNML::Net.new, Util::UUID.generate, "").should.empty_name
|
323
|
+
PNML::Transition.new(PNML::Net.new, Util::UUID.generate, " ").should.empty_name
|
324
|
+
PNML::Transition.new(PNML::Net.new, Util::UUID.generate, " #abc").should.empty_name
|
325
|
+
end
|
326
|
+
end
|
327
|
+
|
328
|
+
TestHelper.scope do |this|
|
329
|
+
this::SAMPLE_NET = Location[__FILE__].dirname + "data" + "SampleNet.pnml"
|
330
|
+
|
331
|
+
describe Pione::PNML::Arc do
|
332
|
+
before do
|
333
|
+
@net = PNML::Reader.read(this::SAMPLE_NET)
|
334
|
+
@transition_A = @net.find_transition_by_name("A")
|
335
|
+
@transition_B = @net.find_transition_by_name("B")
|
336
|
+
@place_i1 = @net.find_place_by_name("<'i1'")
|
337
|
+
@place_i2 = @net.find_place_by_name("<'i2'")
|
338
|
+
@place_i3 = @net.find_place_by_name("<'i3'")
|
339
|
+
@place_p1 = @net.find_place_by_name("'p1'")
|
340
|
+
@place_o1 = @net.find_place_by_name(">'o1'")
|
341
|
+
@place_o2 = @net.find_place_by_name(">'o2'")
|
342
|
+
@place_o3 = @net.find_place_by_name(">'o3'")
|
343
|
+
@arc_i1_A = @net.find_arc(@place_i1.id, @transition_A.id)
|
344
|
+
@arc_i2_A = @net.find_arc(@place_i2.id, @transition_A.id)
|
345
|
+
@arc_i3_A = @net.find_arc(@place_i3.id, @transition_A.id)
|
346
|
+
@arc_A_p1 = @net.find_arc(@transition_A.id, @place_p1.id)
|
347
|
+
@arc_p1_B = @net.find_arc(@place_p1.id, @transition_B.id)
|
348
|
+
@arc_B_o1 = @net.find_arc(@transition_B.id, @place_o1.id)
|
349
|
+
@arc_B_o2 = @net.find_arc(@transition_B.id, @place_o2.id)
|
350
|
+
@arc_B_o3 = @net.find_arc(@transition_B.id, @place_o3.id)
|
351
|
+
end
|
352
|
+
|
353
|
+
it "should distinguish the direction from transition to place" do
|
354
|
+
@arc_i1_A.should.not.from_transition_to_place
|
355
|
+
@arc_i2_A.should.not.from_transition_to_place
|
356
|
+
@arc_i3_A.should.not.from_transition_to_place
|
357
|
+
@arc_A_p1.should.from_transition_to_place
|
358
|
+
@arc_B_o1.should.from_transition_to_place
|
359
|
+
@arc_B_o1.should.from_transition_to_place
|
360
|
+
@arc_B_o1.should.from_transition_to_place
|
361
|
+
end
|
362
|
+
|
363
|
+
it "should distinguish the direction from place to transition" do
|
364
|
+
@arc_i1_A.should.from_place_to_transition
|
365
|
+
@arc_i2_A.should.from_place_to_transition
|
366
|
+
@arc_i3_A.should.from_place_to_transition
|
367
|
+
@arc_A_p1.should.not.from_place_to_transition
|
368
|
+
@arc_B_o1.should.not.from_place_to_transition
|
369
|
+
@arc_B_o1.should.not.from_place_to_transition
|
370
|
+
@arc_B_o1.should.not.from_place_to_transition
|
371
|
+
end
|
372
|
+
end
|
373
|
+
end
|