From dc6e6a343939771bd8faaccf36b31731ffecb50d Mon Sep 17 00:00:00 2001 From: SebastianEbert <sebastian.ebert@tu-dresden.de> Date: Fri, 17 Nov 2023 11:06:09 +0100 Subject: [PATCH] extension for inh arc removal --- .../flatter/transforms/TopicTransforms.jadd | 8 +- .../tudresden/inf/st/pnml/flatter/Main.java | 13 +- .../flatter/template/TemplateConstants.java | 2 + .../pnml/flatter/template/TopicTemplates.java | 106 ++++++++--- .../transform/TransformationUtils.java | 7 +- .../templates/ServiceConnectionTemplate.pnml | 20 +- .../templates/ServiceMultiplexerTemplate.pnml | 20 +- .../templates/TopicPublisherTemplate.pnml | 10 +- .../templates/TopicPublisherTemplateOpt.pnml | 160 ++++++++++++++++ .../TopicSubCallbackQueueTemplate.pnml | 14 +- .../TopicSubCallbackQueueTemplateOpt.pnml | 176 ++++++++++++++++++ .../templates/TopicSubDispatcherTemplate.pnml | 16 +- .../TopicSubDispatcherTemplateOpt.pnml | 144 ++++++++++++++ 13 files changed, 615 insertions(+), 81 deletions(-) create mode 100644 src/main/resources/templates/TopicPublisherTemplateOpt.pnml create mode 100644 src/main/resources/templates/TopicSubCallbackQueueTemplateOpt.pnml create mode 100644 src/main/resources/templates/TopicSubDispatcherTemplateOpt.pnml diff --git a/src/main/jastadd/flatter/transforms/TopicTransforms.jadd b/src/main/jastadd/flatter/transforms/TopicTransforms.jadd index e1750d1..fd86c8e 100644 --- a/src/main/jastadd/flatter/transforms/TopicTransforms.jadd +++ b/src/main/jastadd/flatter/transforms/TopicTransforms.jadd @@ -7,7 +7,7 @@ aspect TopicTransforms { return this.getStaticTransitionInformation().isTopicTransitionInformation(); } - syn Page DinerosTransition.transformTopicElement() { + syn Page DinerosTransition.transformTopicElement(boolean withoutInhibitorArc) { System.out.println("Transforming topic transition: " + this.getId()); TopicTransitionInformation tti = this.getStaticTransitionInformation().asTopicTransitionInformation(); @@ -48,7 +48,7 @@ aspect TopicTransforms { Map<String, Node> pubMap = new HashMap<>(); pubMap.put(TemplateConstants.PLACE_TOPIC_PUBLISHER_REF + "-" + tti.getTopic() + "-" + i, petriNet().getPlaceById(pp.getPlaceId())); pubMap.put(TemplateConstants.PLACE_TOPIC_PUBLISHER_CHANNEL_REF + "-" + tti.getTopic() + "-" + i, pTopic); - PetriNet pubNet = TopicTemplates.getTopicPublisherPetriNet(tti.getTopic() + "-" + i, pp.getLimit()); + PetriNet pubNet = TopicTemplates.getTopicPublisherPetriNet(tti.getTopic() + "-" + i, pp.getLimit(), withoutInhibitorArc); TransformationUtils.includeTemplateInstance(res, petriNet(), pubNet, pubMap, null); i++; } @@ -72,7 +72,7 @@ aspect TopicTransforms { Map<String, Node> dispatchMap = new HashMap<>(); dispatchMap.put(TemplateConstants.TRANSITION_TOPIC_DISPATCHER_CHANNEL_REF + "-" + tti.getTopic() + "-" + j, tTopic); // TODO: make capacity configurable - PetriNet dispatchNet = TopicTemplates.getTopicDispatcherPetriNet(tti.getTopic() + "-" + j, 16); + PetriNet dispatchNet = TopicTemplates.getTopicDispatcherPetriNet(tti.getTopic() + "-" + j, 16, withoutInhibitorArc); Map<String, PnObject> addedObjects = TransformationUtils.includeTemplateInstance(res, petriNet(), dispatchNet, dispatchMap, null); // apply rule T4 @@ -82,7 +82,7 @@ aspect TopicTransforms { subMap.put(TemplateConstants.PLACE_TOPIC_CALLBACK_REF + "-" + tti.getTopic() + "-" + j + "-" + k, petriNet().getPlaceById(sp.getPlaceId())); subMap.put(TemplateConstants.TRANSITION_TOPIC_CALLBACK_INPUT_REF + "-" + tti.getTopic() + "-" + j + "-" + k, addedObjects.get(TemplateConstants.DISPATCHER_OUTPUT_TRANSITION + "-" + tti.getTopic() + "-" + j).asNode()); - PetriNet callbackNet = TopicTemplates.getTopicCallbackQueuePetriNet(tti.getTopic() + "-" + j + "-" + k, sp.getLimit()); + PetriNet callbackNet = TopicTemplates.getTopicCallbackQueuePetriNet(tti.getTopic() + "-" + j + "-" + k, sp.getLimit(), withoutInhibitorArc); TransformationUtils.includeTemplateInstance(res, petriNet(), callbackNet, subMap, null); k++; } diff --git a/src/main/java/de/tudresden/inf/st/pnml/flatter/Main.java b/src/main/java/de/tudresden/inf/st/pnml/flatter/Main.java index 51875f1..fd8ab33 100644 --- a/src/main/java/de/tudresden/inf/st/pnml/flatter/Main.java +++ b/src/main/java/de/tudresden/inf/st/pnml/flatter/Main.java @@ -22,11 +22,14 @@ import java.util.UUID; public class Main { + private static final boolean FLAG_INHIBITOR = true; + public static void main(String[] args) throws InvalidIDException, InterruptedException, IOException { String configPath = null; //((args.length > 1) ? args[1] : null; - String pnmlPath = "/home/sebastian/git/dineros-public/dineros/pnml-relast-apps/" + - "robotic-sorting/rpn-models/sorting-wf-synced-safe-sensor-grpn-minimal-2.pnml"; // (args.length > 0) ? args[0] : null; + String pnmlPath = "/home/sebastian/git/dineros-public/dineros/pnml-relast-apps/robotic-sorting/test-models/pubsub.pnml"; + // "/home/sebastian/git/dineros-public/dineros/pnml-relast-apps/robotic-sorting/rpn-models/full-models/sorting-wf-synced-safe-sensor-grpn-sig.pnml"; + // (args.length > 0) ? args[0] : null; if (pnmlPath == null) { System.out.println("[ERROR] No model found on given input path."); @@ -51,7 +54,7 @@ public class Main { // [STAGE 2] Transform topic transitions for(DinerosTransition dt : petriNet.allDinerosTransitions()){ if(dt.canTransformTopicTransition()){ - Page topicTransformedPage = dt.transformTopicElement(); + Page topicTransformedPage = dt.transformTopicElement(FLAG_INHIBITOR); for ( int i = 0; i < dt.ContainingPage().getNumObject(); i++ ){ if(dt.ContainingPage().getObject(i).getId().equals(dt.getId())){ dt.ContainingPage().setObject(topicTransformedPage, i); @@ -103,6 +106,8 @@ public class Main { } } + printNet(petriNet, true, false); + // [STAGE 6] remove references / pages System.out.println("[FLATTENER] Breaking references and pages."); for(Page p : petriNet.allPages()){ @@ -112,8 +117,6 @@ public class Main { } } - printNet(petriNet, true, false); - // [STAGE 7] export flatted net to pnml System.out.println("[FLATTENER] Exporting to pnml."); String exportId = UUID.randomUUID().toString(); diff --git a/src/main/java/de/tudresden/inf/st/pnml/flatter/template/TemplateConstants.java b/src/main/java/de/tudresden/inf/st/pnml/flatter/template/TemplateConstants.java index ebe22c9..ec3a73d 100644 --- a/src/main/java/de/tudresden/inf/st/pnml/flatter/template/TemplateConstants.java +++ b/src/main/java/de/tudresden/inf/st/pnml/flatter/template/TemplateConstants.java @@ -20,12 +20,14 @@ public final class TemplateConstants { public static final String DISPATCHER_INPUT_PLACE = "DispatcherInputPlace"; public static final String DISPATCHER_OVERFLOW_TRANSITION = "DispatcherOverflowTransition"; public static final String DISPATCHER_CAPACITY_PLACE = "DispatcherCapacityPlace"; + public static final String DISPATCHER_CONNECTOR_PLACE = "DispatcherConnectorPlace"; // topic callback public static final String CALLBACK_INPUT_PLACE = "CallbackInputPlace"; public static final String CALLBACK_OUTPUT_TRANSITION = "CallbackOutputTransition"; public static final String CALLBACK_OVERFLOW_TRANSITION = "CallbackOverflowTransition"; public static final String CALLBACK_CAPACITY_PLACE = "CallbackCapacityPlace"; + public static final String CALLBACK_CONNECTOR_PLACE = "CallbackConnectorPlace"; // template pages public static final String PUBLISHER_TEMPLATE_PAGE = "PublisherTemplatePage"; diff --git a/src/main/java/de/tudresden/inf/st/pnml/flatter/template/TopicTemplates.java b/src/main/java/de/tudresden/inf/st/pnml/flatter/template/TopicTemplates.java index 88ae5d5..e885d1c 100644 --- a/src/main/java/de/tudresden/inf/st/pnml/flatter/template/TopicTemplates.java +++ b/src/main/java/de/tudresden/inf/st/pnml/flatter/template/TopicTemplates.java @@ -1,68 +1,112 @@ package de.tudresden.inf.st.pnml.flatter.template; +import de.tudresden.inf.st.pnml.flatter.transform.TransformationUtils; import de.tudresden.inf.st.pnml.jastadd.model.*; public class TopicTemplates extends PnmlTemplate { - public static PetriNet getTopicPublisherPetriNet(String idSuffix, int capacity){ + public static final String TEMPLATE_PATH = "/src/main/resources/templates/"; + public static final String INH_REPLACE_ARC = "inh-replace-arc-"; + public static final String INH_REPLACE_REV_ARC = "inh-replace-rev-arc-"; - PetriNet templateNet = PnmlParser.parsePnml(homeDirectory + - "/src/main/resources/templates/TopicPublisherTemplate.pnml", false).get(0); + public static PetriNet getTopicPublisherPetriNet(String idSuffix, int capacity, boolean withoutInh){ - for(Place p : templateNet.allPlaces()){ - if(p.getId().equals(TemplateConstants.PUBLISHER_CAPACITY_PLACE)){ - p.getInitialMarking().setText(capacity); - } + if(withoutInh){ + return getTopicPublisherOptPetriNet(idSuffix, capacity); } - for(PnObject po : templateNet.allObjects()){ - if(!po.getId().equals(TemplateConstants.PUBLISHER_TEMPLATE_PAGE)){ - updatePnObjectIdAndName(po, idSuffix); - } - } + PetriNet templateNet = PnmlParser.parsePnml(homeDirectory + + TEMPLATE_PATH + "TopicPublisherTemplate.pnml", false).get(0); + initTemplate(idSuffix, capacity, templateNet, + TemplateConstants.PUBLISHER_CAPACITY_PLACE, TemplateConstants.PUBLISHER_TEMPLATE_PAGE); + return templateNet; + } + + private static PetriNet getTopicPublisherOptPetriNet(String idSuffix, int capacity){ + PetriNet templateNet = PnmlParser.parsePnml(homeDirectory + + TEMPLATE_PATH + "TopicPublisherTemplateOpt.pnml", false).get(0); + addInhibitorReplacementArcs(capacity, templateNet, TemplateConstants.PUBLISHER_CONNECTOR_PLACE, + TemplateConstants.PUBLISHER_OVERFLOW_TRANSITION, "pub-"); + initTemplate(idSuffix, capacity, templateNet, + TemplateConstants.PUBLISHER_CAPACITY_PLACE, TemplateConstants.PUBLISHER_TEMPLATE_PAGE); return templateNet; } - public static PetriNet getTopicDispatcherPetriNet(String idSuffix, int capacity){ + public static PetriNet getTopicDispatcherPetriNet(String idSuffix, int capacity, boolean withoutInh){ - System.out.println("New dispatcher with suffix: " + idSuffix); + if(withoutInh){ + return getTopicDispatcherOptPetriNet(idSuffix, capacity); + } PetriNet templateNet = PnmlParser.parsePnml(homeDirectory - + "/src/main/resources/templates/TopicSubDispatcherTemplate.pnml", false).get(0); + + TEMPLATE_PATH + "TopicSubDispatcherTemplate.pnml", false).get(0); + initTemplate(idSuffix, capacity, templateNet, TemplateConstants.DISPATCHER_CAPACITY_PLACE, + TemplateConstants.DISPATCHER_TEMPLATE_PAGE); + return templateNet; + } - for(Place p : templateNet.allPlaces()){ - if(p.getId().equals(TemplateConstants.DISPATCHER_CAPACITY_PLACE)){ - p.getInitialMarking().setText(capacity); - } - } + public static PetriNet getTopicDispatcherOptPetriNet(String idSuffix, int capacity){ - for(PnObject po : templateNet.allObjects()){ - if(!po.getId().equals(TemplateConstants.DISPATCHER_TEMPLATE_PAGE)){ - updatePnObjectIdAndName(po, idSuffix); - } + PetriNet templateNet = PnmlParser.parsePnml(homeDirectory + + TEMPLATE_PATH + "TopicSubDispatcherTemplateOpt.pnml", false).get(0); + addInhibitorReplacementArcs(capacity, templateNet, TemplateConstants.DISPATCHER_CONNECTOR_PLACE, + TemplateConstants.DISPATCHER_OVERFLOW_TRANSITION, "dis-"); + initTemplate(idSuffix, capacity, templateNet, TemplateConstants.DISPATCHER_CAPACITY_PLACE, + TemplateConstants.DISPATCHER_TEMPLATE_PAGE); + return templateNet; + } + + public static PetriNet getTopicCallbackQueuePetriNet(String idSuffix, int capacity, boolean withoutInh){ + + if(withoutInh){ + return getTopicCallbackQueueOptPetriNet(idSuffix, capacity); } + PetriNet templateNet = PnmlParser.parsePnml(homeDirectory + + TEMPLATE_PATH + "TopicSubCallbackQueueTemplate.pnml", false).get(0); + initTemplate(idSuffix, capacity, templateNet, TemplateConstants.CALLBACK_CAPACITY_PLACE, + TemplateConstants.CALLBACK_QUEUE_TEMPLATE_PAGE); return templateNet; } - public static PetriNet getTopicCallbackQueuePetriNet(String idSuffix, int capacity){ + public static PetriNet getTopicCallbackQueueOptPetriNet(String idSuffix, int capacity){ PetriNet templateNet = PnmlParser.parsePnml(homeDirectory - + "/src/main/resources/templates/TopicSubCallbackQueueTemplate.pnml", false).get(0); + + TEMPLATE_PATH + "TopicSubCallbackQueueTemplateOpt.pnml", false).get(0); + addInhibitorReplacementArcs(capacity, templateNet, TemplateConstants.CALLBACK_CONNECTOR_PLACE, + TemplateConstants.CALLBACK_OVERFLOW_TRANSITION, "callback-"); + initTemplate(idSuffix, capacity, templateNet, TemplateConstants.CALLBACK_CAPACITY_PLACE, + TemplateConstants.CALLBACK_QUEUE_TEMPLATE_PAGE); + return templateNet; + } - for(Place p : templateNet.allPlaces()){ - if(p.getId().equals(TemplateConstants.CALLBACK_CAPACITY_PLACE)){ + private static void initTemplate(String idSuffix, int capacity, PetriNet templateNet, + String capacityPlace, String templatePage) { + for (Place p : templateNet.allPlaces()) { + if (p.getId().equals(capacityPlace)) { p.getInitialMarking().setText(capacity); } } - for(PnObject po : templateNet.allObjects()){ - if(!po.getId().equals(TemplateConstants.CALLBACK_QUEUE_TEMPLATE_PAGE)){ + for (PnObject po : templateNet.allObjects()) { + if (!po.getId().equals(templatePage)) { updatePnObjectIdAndName(po, idSuffix); } } + } - return templateNet; + private static void addInhibitorReplacementArcs(int capacity, PetriNet templateNet, + String connectorPlace, String overflowTransition, String templatePrefix) { + for (int i = 0; i < capacity; i++) { + TransformationUtils.createAndIncludeArc(templateNet.getPage(0), templatePrefix + INH_REPLACE_ARC + i, + templateNet.getPlaceById(connectorPlace), + templateNet.getTransitionById(overflowTransition)); + TransformationUtils.createAndIncludeArc(templateNet.getPage(0), templatePrefix + INH_REPLACE_REV_ARC + i, + templateNet.getTransitionById(overflowTransition), + templateNet.getPlaceById(connectorPlace)); + } + + templateNet.flushTreeCache(); } } diff --git a/src/main/java/de/tudresden/inf/st/pnml/flatter/transform/TransformationUtils.java b/src/main/java/de/tudresden/inf/st/pnml/flatter/transform/TransformationUtils.java index 253451a..c26f21b 100644 --- a/src/main/java/de/tudresden/inf/st/pnml/flatter/transform/TransformationUtils.java +++ b/src/main/java/de/tudresden/inf/st/pnml/flatter/transform/TransformationUtils.java @@ -16,6 +16,10 @@ public class TransformationUtils { a.setId(id); a.setSource(s); a.setTarget(t); + + Name n = new Name(); + n.setText(a.getId()); + a.setName(n); return a; } @@ -108,7 +112,8 @@ public class TransformationUtils { // connect elements by arcs for (Arc a : templateInstance.allArcs()) { Arc newArc = new Arc(); - newArc.setId("arc-" + a.getSource().getId() + "-" + a.getTarget().getId()); + newArc.setId(a.getId()); + //newArc.setId("arc-" + a.getSource().getId() + "-" + a.getTarget().getId()); newArc.setTarget((Node) getPnObjectByID(templateInstance, a.getTarget().getId())); newArc.setSource((Node) getPnObjectByID(templateInstance, a.getSource().getId())); diff --git a/src/main/resources/templates/ServiceConnectionTemplate.pnml b/src/main/resources/templates/ServiceConnectionTemplate.pnml index 4d8024e..09ca935 100644 --- a/src/main/resources/templates/ServiceConnectionTemplate.pnml +++ b/src/main/resources/templates/ServiceConnectionTemplate.pnml @@ -228,25 +228,25 @@ </graphics> </referencePlace> - <arc id="arc-1" source="ServiceCallRefPlace" target="ServiceClientCallConnectTransition"> + <arc id="scon-arc-1" source="ServiceCallRefPlace" target="ServiceClientCallConnectTransition"> </arc> - <arc id="arc-2" source="ServiceTogglePlace" target="ServiceClientCallConnectTransition"> + <arc id="scon-arc-2" source="ServiceTogglePlace" target="ServiceClientCallConnectTransition"> </arc> - <arc id="arc-3" source="ServiceClientCallConnectTransition" target="ServiceClientCallConnectPlace"> + <arc id="scon-arc-3" source="ServiceClientCallConnectTransition" target="ServiceClientCallConnectPlace"> </arc> - <arc id="arc-4" source="ServiceClientCallConnectPlace" target="ServiceClientCallTransition"> + <arc id="scon-arc-4" source="ServiceClientCallConnectPlace" target="ServiceClientCallTransition"> </arc> - <arc id="arc-5" source="ServiceClientCallTransition" target="ServiceClientCallPlace"> + <arc id="scon-arc-5" source="ServiceClientCallTransition" target="ServiceClientCallPlace"> </arc> - <arc id="arc-6" source="ServiceClientRespConnectTransition" target="ServiceTogglePlace"> + <arc id="scon-arc-6" source="ServiceClientRespConnectTransition" target="ServiceTogglePlace"> </arc> - <arc id="arc-7" source="ServiceClientRespConnectTransition" target="ServiceRespRefPlace"> + <arc id="scon-arc-7" source="ServiceClientRespConnectTransition" target="ServiceRespRefPlace"> </arc> - <arc id="arc-8" source="ServiceClientRespConnectPlace" target="ServiceClientRespConnectTransition"> + <arc id="scon-arc-8" source="ServiceClientRespConnectPlace" target="ServiceClientRespConnectTransition"> </arc> - <arc id="arc-9" source="ServiceClientRespTransition" target="ServiceClientRespConnectPlace"> + <arc id="scon-arc-9" source="ServiceClientRespTransition" target="ServiceClientRespConnectPlace"> </arc> - <arc id="arc-10" source="ServiceClientRespPlace" target="ServiceClientRespTransition"> + <arc id="scon-arc-10" source="ServiceClientRespPlace" target="ServiceClientRespTransition"> </arc> </page> diff --git a/src/main/resources/templates/ServiceMultiplexerTemplate.pnml b/src/main/resources/templates/ServiceMultiplexerTemplate.pnml index 48a7de5..5585882 100644 --- a/src/main/resources/templates/ServiceMultiplexerTemplate.pnml +++ b/src/main/resources/templates/ServiceMultiplexerTemplate.pnml @@ -162,25 +162,25 @@ </graphics> </referencePlace> - <arc id="arc-1" source="ServiceCallMultiCallRefPlace" target="ServiceCallMultiEntryTransition"> + <arc id="smu-arc-1" source="ServiceCallMultiCallRefPlace" target="ServiceCallMultiEntryTransition"> </arc> - <arc id="arc-2" source="ServiceCallMultiEntryTransition" target="ServiceCallMultiActiveRefPlace"> + <arc id="smu-arc-2" source="ServiceCallMultiEntryTransition" target="ServiceCallMultiActiveRefPlace"> </arc> - <arc id="arc-3" source="ServiceCallMultiEntryTransition" target="ServiceCallMultiFlagPlace"> + <arc id="smu-arc-3" source="ServiceCallMultiEntryTransition" target="ServiceCallMultiFlagPlace"> </arc> - <arc id="arc-4" source="ServiceCallMultiActiveRefPlace" target="ServiceCallMultiExitTransition"> + <arc id="smu-arc-4" source="ServiceCallMultiActiveRefPlace" target="ServiceCallMultiExitTransition"> </arc> - <arc id="arc-5" source="ServiceCallMultiFlagPlace" target="ServiceCallMultiExitTransition"> + <arc id="smu-arc-5" source="ServiceCallMultiFlagPlace" target="ServiceCallMultiExitTransition"> </arc> - <arc id="arc-6" source="ServiceCallMultiExitTransition" target="ServiceCallMultiInactiveRefPlace"> + <arc id="smu-arc-6" source="ServiceCallMultiExitTransition" target="ServiceCallMultiInactiveRefPlace"> </arc> - <arc id="arc-7" source="ServiceCallMultiInactiveRefPlace" target="ServiceCallMultiEntryTransition"> + <arc id="smu-arc-7" source="ServiceCallMultiInactiveRefPlace" target="ServiceCallMultiEntryTransition"> </arc> - <arc id="arc-8" source="ServiceCallMultiEntryTransition" target="ServiceCallMultiEntryRefPlace"> + <arc id="smu-arc-8" source="ServiceCallMultiEntryTransition" target="ServiceCallMultiEntryRefPlace"> </arc> - <arc id="arc-9" source="ServiceCallMultiExitRefPlace" target="ServiceCallMultiExitTransition"> + <arc id="smu-arc-9" source="ServiceCallMultiExitRefPlace" target="ServiceCallMultiExitTransition"> </arc> - <arc id="arc-10" source="ServiceCallMultiExitTransition" target="ServiceCallMultiRespRefPlace"> + <arc id="smu-arc-10" source="ServiceCallMultiExitTransition" target="ServiceCallMultiRespRefPlace"> </arc> </page> </net> diff --git a/src/main/resources/templates/TopicPublisherTemplate.pnml b/src/main/resources/templates/TopicPublisherTemplate.pnml index 176cd01..d86f399 100644 --- a/src/main/resources/templates/TopicPublisherTemplate.pnml +++ b/src/main/resources/templates/TopicPublisherTemplate.pnml @@ -147,15 +147,15 @@ </graphics> </transition> - <arc id="arc-1" source="PublisherCapacityPlace" target="PublisherInputTransition"> + <arc id="pub-arc-1" source="PublisherCapacityPlace" target="PublisherInputTransition"> </arc> - <arc id="arc-2" source="PublisherInputTransition" target="PublisherConnectorPlace"> + <arc id="pub-arc-2" source="PublisherInputTransition" target="PublisherConnectorPlace"> </arc> - <arc id="arc-3" source="PublisherConnectorPlace" target="PublisherOutputTransition"> + <arc id="pub-arc-3" source="PublisherConnectorPlace" target="PublisherOutputTransition"> </arc> - <arc id="arc-4" source="PublisherOutputTransition" target="PublisherCapacityPlace"> + <arc id="pub-arc-4" source="PublisherOutputTransition" target="PublisherCapacityPlace"> </arc> - <arc id="arc-5" source="PublisherCapacityPlace" target="PublisherOverflowTransition"> + <arc id="pub-arc-5" source="PublisherCapacityPlace" target="PublisherOverflowTransition"> <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> <type>inhibitor</type> </toolspecific> diff --git a/src/main/resources/templates/TopicPublisherTemplateOpt.pnml b/src/main/resources/templates/TopicPublisherTemplateOpt.pnml new file mode 100644 index 0000000..3f6683f --- /dev/null +++ b/src/main/resources/templates/TopicPublisherTemplateOpt.pnml @@ -0,0 +1,160 @@ +<pnml xmlns="http://www.pnml.org/version-2009/grammar/pnml"> + <net id="DinerosTemplate" type ="http://www.pnml.org/version-2009/grammar/ptnet"> + <name> + <text>DinerosTemplate</text> + </name> + <page id="DinerosTemplatePage"> + + <!-- the reference target is just used here, because pnml does not allow dangling refs --> + <referencePlace id="PublisherPlaceRef" ref="PublisherCapacityPlace"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + </toolspecific> + <name> + <text>PublisherPlaceRef</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <graphics> + <position x="20" y="20"/> + </graphics> + </referencePlace> + + <arc id="arc-6" source="PublisherPlaceRef" target="PublisherOverflowTransition"> + </arc> + <arc id="arc-7" source="PublisherPlaceRef" target="PublisherInputTransition"> + </arc> + + <referencePlace id="PublisherChannelPlaceRef" ref="PublisherCapacityPlace"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + </toolspecific> + <name> + <text>PublisherChannelPlaceRef</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <graphics> + <position x="20" y="20"/> + </graphics> + </referencePlace> + + <arc id="arc-8" source="PublisherOutputTransition" target="PublisherChannelPlaceRef"> + </arc> + + <place id="PublisherCapacityPlace"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discretePlaceType</type> + <outputsignalbindings> + </outputsignalbindings> + </toolspecific> + <name> + <text>PublisherCapacityPlace</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <initialMarking> + <text>16</text> + </initialMarking> + <graphics> + <position x="0" y="0"/> + </graphics> + </place> + <place id="PublisherConnectorPlace"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discretePlaceType</type> + <outputsignalbindings> + </outputsignalbindings> + </toolspecific> + <name> + <text>PublisherConnectorPlace</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <initialMarking> + <text>0</text> + </initialMarking> + <graphics> + <position x="0" y="0"/> + </graphics> + </place> + + <transition id="PublisherInputTransition"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discreteTransitionType</type> + <inputsignalbindings> + </inputsignalbindings> + <inputsignalclause></inputsignalclause> + </toolspecific> + <name> + <text>PublisherInputTransition</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <graphics> + <position x="0" y="0"/> + </graphics> + </transition> + <transition id="PublisherOverflowTransition"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discreteTransitionType</type> + <inputsignalbindings> + </inputsignalbindings> + <inputsignalclause></inputsignalclause> + </toolspecific> + <name> + <text>PublisherOverflowTransition</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <graphics> + <position x="0" y="0"/> + </graphics> + </transition> + <transition id="PublisherOutputTransition"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discreteTransitionType</type> + <inputsignalbindings> + </inputsignalbindings> + <inputsignalclause></inputsignalclause> + </toolspecific> + <name> + <text>PublisherOutputTransition</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <graphics> + <position x="0" y="0"/> + </graphics> + </transition> + + <arc id="pub-arc-1" source="PublisherCapacityPlace" target="PublisherInputTransition"> + </arc> + <arc id="pub-arc-2" source="PublisherInputTransition" target="PublisherConnectorPlace"> + </arc> + <arc id="pub-arc-3" source="PublisherConnectorPlace" target="PublisherOutputTransition"> + </arc> + <arc id="pub-arc-4" source="PublisherOutputTransition" target="PublisherCapacityPlace"> + </arc> + </page> + </net> +</pnml> diff --git a/src/main/resources/templates/TopicSubCallbackQueueTemplate.pnml b/src/main/resources/templates/TopicSubCallbackQueueTemplate.pnml index 09acfe4..d783b92 100644 --- a/src/main/resources/templates/TopicSubCallbackQueueTemplate.pnml +++ b/src/main/resources/templates/TopicSubCallbackQueueTemplate.pnml @@ -159,22 +159,22 @@ </graphics> </transition> - <arc id="arc-1" source="CallbackCapacityPlace" target="CallbackInputTransition"> + <arc id="callback-arc-1" source="CallbackCapacityPlace" target="CallbackInputTransition"> </arc> - <arc id="arc-2" source="CallbackInputTransition" target="CallbackConnectorPlace"> + <arc id="callback-arc-2" source="CallbackInputTransition" target="CallbackConnectorPlace"> </arc> - <arc id="arc-3" source="CallbackConnectorPlace" target="CallbackOutputTransition"> + <arc id="callback-arc-3" source="CallbackConnectorPlace" target="CallbackOutputTransition"> </arc> - <arc id="arc-4" source="CallbackOutputTransition" target="CallbackCapacityPlace"> + <arc id="callback-arc-4" source="CallbackOutputTransition" target="CallbackCapacityPlace"> </arc> - <arc id="arc-5" source="CallbackCapacityPlace" target="CallbackOverflowTransition"> + <arc id="callback-arc-5" source="CallbackCapacityPlace" target="CallbackOverflowTransition"> <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> <type>inhibitor</type> </toolspecific> </arc> - <arc id="arc-6" source="CallbackInputPlace" target="CallbackInputTransition"> + <arc id="callback-arc-6" source="CallbackInputPlace" target="CallbackInputTransition"> </arc> - <arc id="arc-7" source="CallbackInputPlace" target="CallbackOverflowTransition"> + <arc id="callback-arc-7" source="CallbackInputPlace" target="CallbackOverflowTransition"> </arc> </page> </net> diff --git a/src/main/resources/templates/TopicSubCallbackQueueTemplateOpt.pnml b/src/main/resources/templates/TopicSubCallbackQueueTemplateOpt.pnml new file mode 100644 index 0000000..0249c95 --- /dev/null +++ b/src/main/resources/templates/TopicSubCallbackQueueTemplateOpt.pnml @@ -0,0 +1,176 @@ +<pnml xmlns="http://www.pnml.org/version-2009/grammar/pnml"> + <net id="DinerosTemplate" type ="http://www.pnml.org/version-2009/grammar/ptnet"> + <name> + <text>DinerosTemplate</text> + </name> + <page id="DinerosTemplatePage"> + + <!-- the reference target is just used here, because pnml does not allow dangling refs --> + <referenceTransition id="CallbackInputRefTransition" ref="CallbackInputTransition"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>channel</location> + <subnet>channel</subnet> + </toolspecific> + </referenceTransition> + + <arc id="arc-8" source="CallbackInputRefTransition" target="CallbackInputPlace"> + </arc> + + <!-- the reference target is just used here, because pnml does not allow dangling refs --> + <referencePlace id="CallbackRefPlace" ref="CallbackInputPlace"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + </toolspecific> + <name> + <text>CallbackRefPlace</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <graphics> + <position x="20" y="20"/> + </graphics> + </referencePlace> + + <arc id="arc-9" source="CallbackOutputTransition" target="CallbackRefPlace"> + </arc> + + <place id="CallbackCapacityPlace"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discretePlaceType</type> + <outputsignalbindings> + </outputsignalbindings> + </toolspecific> + <name> + <text>CallbackCapacityPlace</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <initialMarking> + <text>16</text> + </initialMarking> + <graphics> + <position x="0" y="0"/> + </graphics> + </place> + <place id="CallbackConnectorPlace"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discretePlaceType</type> + <outputsignalbindings> + </outputsignalbindings> + </toolspecific> + <name> + <text>CallbackConnectorPlace</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <initialMarking> + <text>0</text> + </initialMarking> + <graphics> + <position x="0" y="0"/> + </graphics> + </place> + + <place id="CallbackInputPlace"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discretePlaceType</type> + <outputsignalbindings> + </outputsignalbindings> + </toolspecific> + <name> + <text>CallbackInputPlace</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <initialMarking> + <text>0</text> + </initialMarking> + <graphics> + <position x="0" y="0"/> + </graphics> + </place> + + <transition id="CallbackInputTransition"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discreteTransitionType</type> + <inputsignalbindings> + </inputsignalbindings> + <inputsignalclause></inputsignalclause> + </toolspecific> + <name> + <text>CallbackInputTransition</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <graphics> + <position x="0" y="0"/> + </graphics> + </transition> + <transition id="CallbackOverflowTransition"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discreteTransitionType</type> + <inputsignalbindings> + </inputsignalbindings> + <inputsignalclause></inputsignalclause> + </toolspecific> + <name> + <text>CallbackOverflowTransition</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <graphics> + <position x="0" y="0"/> + </graphics> + </transition> + <transition id="CallbackOutputTransition"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discreteTransitionType</type> + <inputsignalbindings> + </inputsignalbindings> + <inputsignalclause></inputsignalclause> + </toolspecific> + <name> + <text>CallbackOutputTransition</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <graphics> + <position x="0" y="0"/> + </graphics> + </transition> + + <arc id="callback-arc-1" source="CallbackCapacityPlace" target="CallbackInputTransition"> + </arc> + <arc id="callback-arc-2" source="CallbackInputTransition" target="CallbackConnectorPlace"> + </arc> + <arc id="callback-arc-3" source="CallbackConnectorPlace" target="CallbackOutputTransition"> + </arc> + <arc id="callback-arc-4" source="CallbackOutputTransition" target="CallbackCapacityPlace"> + </arc> + <arc id="callback-arc-6" source="CallbackInputPlace" target="CallbackInputTransition"> + </arc> + <arc id="callback-arc-7" source="CallbackInputPlace" target="CallbackOverflowTransition"> + </arc> + </page> + </net> +</pnml> diff --git a/src/main/resources/templates/TopicSubDispatcherTemplate.pnml b/src/main/resources/templates/TopicSubDispatcherTemplate.pnml index 436e4ee..ec0470e 100644 --- a/src/main/resources/templates/TopicSubDispatcherTemplate.pnml +++ b/src/main/resources/templates/TopicSubDispatcherTemplate.pnml @@ -125,24 +125,24 @@ </graphics> </transition> - <arc id="arc-1" source="DispatcherCapacityPlace" target="DispatcherInputTransition"> + <arc id="dis-arc-1" source="DispatcherCapacityPlace" target="DispatcherInputTransition"> </arc> - <arc id="arc-2" source="DispatcherInputTransition" target="DispatcherConnectorPlace"> + <arc id="dis-arc-2" source="DispatcherInputTransition" target="DispatcherConnectorPlace"> </arc> - <arc id="arc-3" source="DispatcherConnectorPlace" target="DispatcherOutputTransition"> + <arc id="dis-arc-3" source="DispatcherConnectorPlace" target="DispatcherOutputTransition"> </arc> - <arc id="arc-4" source="DispatcherOutputTransition" target="DispatcherCapacityPlace"> + <arc id="dis-arc-4" source="DispatcherOutputTransition" target="DispatcherCapacityPlace"> </arc> - <arc id="arc-5" source="DispatcherCapacityPlace" target="DispatcherOverflowTransition"> + <arc id="dis-arc-5" source="DispatcherCapacityPlace" target="DispatcherOverflowTransition"> <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> <type>inhibitor</type> </toolspecific> </arc> - <arc id="arc-6" source="DispatcherInputPlace" target="DispatcherInputTransition"> + <arc id="dis-arc-6" source="DispatcherInputPlace" target="DispatcherInputTransition"> </arc> - <arc id="arc-7" source="DispatcherInputPlace" target="DispatcherOverflowTransition"> + <arc id="dis-arc-7" source="DispatcherInputPlace" target="DispatcherOverflowTransition"> </arc> - <arc id="arc-8" source="DispatcherChannelTransitionRef" target="DispatcherInputPlace"> + <arc id="dis-arc-8" source="DispatcherChannelTransitionRef" target="DispatcherInputPlace"> </arc> </page> </net> diff --git a/src/main/resources/templates/TopicSubDispatcherTemplateOpt.pnml b/src/main/resources/templates/TopicSubDispatcherTemplateOpt.pnml new file mode 100644 index 0000000..7b42523 --- /dev/null +++ b/src/main/resources/templates/TopicSubDispatcherTemplateOpt.pnml @@ -0,0 +1,144 @@ +<pnml xmlns="http://www.pnml.org/version-2009/grammar/pnml"> + <net id="DinerosTemplate" type ="http://www.pnml.org/version-2009/grammar/ptnet"> + <name> + <text>DinerosTemplate</text> + </name> + + <page id="DinerosTemplatePage"> + + <!-- the reference target is just used here, because pnml does not allow dangling refs --> + <referenceTransition id="DispatcherChannelTransitionRef" ref="DispatcherInputTransition"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>channel</location> + <subnet>channel</subnet> + </toolspecific> + </referenceTransition> + + <place id="DispatcherCapacityPlace"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discretePlaceType</type> + </toolspecific> + <name> + <text>DispatcherCapacityPlace</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <initialMarking> + <text>16</text> + </initialMarking> + <graphics> + <position x="0" y="0"/> + </graphics> + </place> + <place id="DispatcherConnectorPlace"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discretePlaceType</type> + </toolspecific> + <name> + <text>DispatcherConnectorPlace</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <initialMarking> + <text>0</text> + </initialMarking> + <graphics> + <position x="0" y="0"/> + </graphics> + </place> + + <place id="DispatcherInputPlace"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discretePlaceType</type> + </toolspecific> + <name> + <text>DispatcherInputPlace</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <initialMarking> + <text>0</text> + </initialMarking> + <graphics> + <position x="0" y="0"/> + </graphics> + </place> + + <transition id="DispatcherInputTransition"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discreteTransitionType</type> + <inputsignalclause></inputsignalclause> + </toolspecific> + <name> + <text>DispatcherInputTransition</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <graphics> + <position x="0" y="0"/> + </graphics> + </transition> + <transition id="DispatcherOverflowTransition"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discreteTransitionType</type> + <inputsignalclause></inputsignalclause> + </toolspecific> + <name> + <text>DispatcherOverflowTransition</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <graphics> + <position x="0" y="0"/> + </graphics> + </transition> + <transition id="DispatcherOutputTransition"> + <toolspecific tool="de.tudresden.inf.st.pnml.distributedPN" version="0.1"> + <location>none</location> + <subnet>none</subnet> + <type>discreteTransitionType</type> + <inputsignalclause></inputsignalclause> + </toolspecific> + <name> + <text>DispatcherOutputTransition</text> + <graphics> + <offset x="0" y="0" /> + </graphics> + </name> + <graphics> + <position x="0" y="0"/> + </graphics> + </transition> + + <arc id="dis-arc-1" source="DispatcherCapacityPlace" target="DispatcherInputTransition"> + </arc> + <arc id="dis-arc-2" source="DispatcherInputTransition" target="DispatcherConnectorPlace"> + </arc> + <arc id="dis-arc-3" source="DispatcherConnectorPlace" target="DispatcherOutputTransition"> + </arc> + <arc id="dis-arc-4" source="DispatcherOutputTransition" target="DispatcherCapacityPlace"> + </arc> + <arc id="dis-arc-6" source="DispatcherInputPlace" target="DispatcherInputTransition"> + </arc> + <arc id="dis-arc-7" source="DispatcherInputPlace" target="DispatcherOverflowTransition"> + </arc> + <arc id="dis-arc-8" source="DispatcherChannelTransitionRef" target="DispatcherInputPlace"> + </arc> + </page> + </net> +</pnml> -- GitLab