Skip to content
Snippets Groups Projects
Commit 52d582fb authored by Sebastian Ebert's avatar Sebastian Ebert
Browse files

updated service modelling to v4

parent 85c45a4a
No related branches found
No related tags found
No related merge requests found
......@@ -22,21 +22,17 @@ public class Main {
public static void main(String[] args) throws IOException, InvalidIDException, InterruptedException {
String configPath = (args.length > 1) ? args[1] : null;
/* String pnmlPath = (args.length > 0) ? args[0] : null;
String pnmlPath = (args.length > 0) ? args[0] : null;
if (pnmlPath == null || configPath == null) {
System.out.println("No model found on given input path.");
return;
}*/
}
// parse the global not flatted petri net
// String pnmlPath = "../pnml-relast-nets/src/main/resources/topicTestNets/structureTestNets/topic-structure-correct.pnml";
String pnmlPath = "../pnml-relast-nets/src/main/resources/useCaseNets/RoboticUseCase-TopLayer-Left.pnml";
// String pnmlPath = "../pnml-relast-nets/src/main/resources/useCaseNets/TopicEvaluation/RoboticUseCase-TopLayer-TopicScale-NoSignals.pnml";
// String pnmlPath = "../pnml-relast-nets/src/main/resources/useCaseNets/RoboticUseCase-AllLayers.pnml";
// String pnmlPath = "../pnml-relast-nets/src/main/resources/useCaseNets/TopicEvaluation/PublisherScale/RoboticUseCase-TopLayer-PublisherScale-6.pnml";
// String pnmlPath = "../pnml-relast-nets/src/main/resources/serviceTestNets/structureTestNets/service-structure-correct.pnml";*/
configPath = "src/main/config/siftConfig.json";
// configPath = "src/main/config/siftConfig.json";
PetriNet petriNet = PnmlParser.parsePnml(pnmlPath).get(0);
// read config for analyzer from file
......
......@@ -116,22 +116,12 @@ public class ChannelFlatter extends Flatter {
petriNet.flushTreeCache();
InputSignalTransition dispatcherOutput = (InputSignalTransition) getPnObjectByID(petriNet, TemplateConstants.DISPATCHER_OUTPUT_TRANSITION + "-" + dispatcherCount);
// include subscriber queues
for (Place p : entry.getValue()) {
PetriNet subscriberNet = TopicTemplates.getTopicCallbackQueuePetriNet(String.valueOf(callbackCount), receiverCapacity);
includeTemplateInstance(petriNet, subscriberNet, entry.getKey(), p.asOutputSignalPlace().getStaticPlaceInformation().getLocation());
// Arc callbackInputArc = new Arc();
// Arc callbackOverFlowArc = new Arc();
// Arc callbackOutArc = new Arc();
// callbackInputArc.setId("callbackInputArc-" + dispatcherCount);
// callbackOverFlowArc.setId("callbackOverFlowArc-" + dispatcherCount);
// callbackOutArc.setId("callbackOutArc-" + dispatcherCount);
// callbackInputArc
createAndIncludeArc(topPage, "callbackInputArc-" + dispatcherCount, (Node) getPnObjectByID(petriNet, TemplateConstants.DISPATCHER_OUTPUT_TRANSITION + "-" + dispatcherCount),
(Node) getPnObjectByID(petriNet, TemplateConstants.CALLBACK_INPUT_PLACE + "-" + callbackCount));
......@@ -140,22 +130,12 @@ public class ChannelFlatter extends Flatter {
createAndIncludeArc(topPage, "callbackOverFlowArc-" + dispatcherCount, (Node) getPnObjectByID(petriNet, TemplateConstants.CALLBACK_INPUT_PLACE + "-" + dispatcherCount),
(Node) getPnObjectByID(petriNet, TemplateConstants.CALLBACK_OVERFLOW_TRANSITION + "-" + callbackCount));
// callbackOutArc
createAndIncludeArc(topPage, "callbackOutArc-" + dispatcherCount, (Node) getPnObjectByID(petriNet, TemplateConstants.CALLBACK_OUTPUT_TRANSITION + "-" + dispatcherCount), p);
// callbackInputArc.setSource((Node) getPnObjectByID(petriNet, TemplateConstants.DISPATCHER_OUTPUT_TRANSITION + "-" + dispatcherCount));
// callbackOverFlowArc.setSource((Node) getPnObjectByID(petriNet, TemplateConstants.CALLBACK_INPUT_PLACE + "-" + dispatcherCount));
// callbackInputArc.setTarget((Node) getPnObjectByID(petriNet, TemplateConstants.CALLBACK_INPUT_PLACE + "-" + callbackCount));
// callbackOverFlowArc.setTarget((Node) getPnObjectByID(petriNet, TemplateConstants.CALLBACK_OVERFLOW_TRANSITION + "-" + callbackCount));
// callbackOutArc.setSource((Node) getPnObjectByID(petriNet, TemplateConstants.CALLBACK_OUTPUT_TRANSITION + "-" + callbackCount));
// callbackOutArc.setSource(p);
callbackCount++;
}
// TODO: connect subscriber and dispatcher
dispatcherCount++;
}
......@@ -491,8 +471,8 @@ public class ChannelFlatter extends Flatter {
createAndIncludeArc(topPage, "queue-to-server-place-arc-" + channel_suffix, getPlaceByID(petriNet, TemplateConstants.SERVICE_QUEUE_TO_SERVER_PLACE + "-" + channel_suffix),
getTransitionByID(petriNet, TemplateConstants.SERVICE_SERVER_INPUT_TRANSITION + "-" + channel_suffix));
createAndIncludeArc(topPage, "client-to-server-input" + channel_suffix, getPlaceByID(petriNet, TemplateConstants.SERVICE_TO_QUEUE_PLACE + "-" + channel_suffix),
getTransitionByID(petriNet, TemplateConstants.SERVICE_SERVER_INPUT_TRANSITION + "-" + channel_suffix));
// createAndIncludeArc(topPage, "client-to-server-input" + channel_suffix, getPlaceByID(petriNet, TemplateConstants.SERVICE_TO_QUEUE_PLACE + "-" + channel_suffix),
// getTransitionByID(petriNet, TemplateConstants.SERVICE_SERVER_INPUT_TRANSITION + "-" + channel_suffix));
createAndIncludeArc(topPage, "server-output-to-queue-cap-arc-" + channel_suffix, getTransitionByID(petriNet, TemplateConstants.SERVICE_SERVER_OUTPUT_TRANSITION + "-" + channel_suffix),
getPlaceByID(petriNet, TemplateConstants.SERVICE_QUEUE_CAPACITY_PLACE + "-" + queue_suffix));
createAndIncludeArc(topPage, "client-connector-to-service-to-queue-arc-" + channel_suffix, getTransitionByID(petriNet, TemplateConstants.SERVICE_CLIENT_CONNECTOR_TRANSITION + "-" + channel_suffix),
......
......@@ -299,8 +299,8 @@
<arc id="arc-9" source="ClientToServicePlace" target="ServiceClientConnectorTransition">
</arc>
<arc id="arc-10" source="ServiceQueueConnectorTransition" target="ServiceToQueuePlace">
</arc>
<!-- <arc id="arc-10" source="ServiceQueueConnectorTransition" target="ServiceToQueuePlace">
</arc> -->
<arc id="arc-11" source="ServiceToQueuePlace" target="ServiceQueueConnectorTransition">
</arc>
<arc id="arc-12" source="ServiceToQueuePlace" target="ServiceQueueOverflowTransition">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment