To prevent spam users, you can only post on this forum after registration, which is by invitation. If you want to post on the forum, please send me a mail (h DOT m DOT w DOT verbeek AT tue DOT nl) and I'll send you an invitation in return for an account.
Add an initial and final marking to a Petri net discovered with own algorithm
Dear community,
sorry I have to bother you again...
I try to add an initial as well as a final marking to my discovered petri net, so that it is directly usable for conformance checking.
I tried this:
_____________________________________________________________________________________
//create markings and connections
Place source = null;
Place sink = null;
for(Place p : net.getPlaces()){
if(net.getInEdges(p).isEmpty())
source = p;
if(net.getOutEdges(p).isEmpty())
sink = p;
}
Marking sourceM = new Marking();
sourceM.add(source);
Marking sinkM = new Marking();
sinkM.add(source);
InitialMarkingConnection imc = new InitialMarkingConnection(net, sourceM);
FinalMarkingConnection fmc = new FinalMarkingConnection(net, sinkM);
___________________________________________________________________________________
But I don't get the connections as outputs. Can you tell me if I am doing this right?
I remember there was a method to return intermediate results, but I forgot the name of the method.
Kind regards,
Oliver
sorry I have to bother you again...
I try to add an initial as well as a final marking to my discovered petri net, so that it is directly usable for conformance checking.
I tried this:
_____________________________________________________________________________________
//create markings and connections
Place source = null;
Place sink = null;
for(Place p : net.getPlaces()){
if(net.getInEdges(p).isEmpty())
source = p;
if(net.getOutEdges(p).isEmpty())
sink = p;
}
Marking sourceM = new Marking();
sourceM.add(source);
Marking sinkM = new Marking();
sinkM.add(source);
InitialMarkingConnection imc = new InitialMarkingConnection(net, sourceM);
FinalMarkingConnection fmc = new FinalMarkingConnection(net, sinkM);
___________________________________________________________________________________
But I don't get the connections as outputs. Can you tell me if I am doing this right?
I remember there was a method to return intermediate results, but I forgot the name of the method.
Kind regards,
Oliver
Comments
-
Dear Oliver,
You're almost there. The only thing left to do is to add both connections to the ProM framework:context.addConnection(imc);
The replayer wil check the connections in the ProM framework for the initial and final marking. If you do not add them to the framework, the replayer will not be bale to find them.
context.addConnection(fmc);
Of course, you do need a context (a PluginContext) to do this.
Kind regards,
Eric.
-
Btw, I would add the sink place to the sink marking, not the source place :-).
-
Oh, and perhaps also a good idea to make the markings provided objects, might also help: The following snippet shows what I am using:
context.getProvidedObjectManager().createProvidedObject(
Note that I allow multiple final markings. The replayer can handle that.
"Initial marking for " + net.getLabel(),
initialMarking, Marking.class, context);
context.addConnection(new InitialMarkingConnection(net,
initialMarking));
for (Marking finalMarking : finalMarkings) {
context.getProvidedObjectManager().createProvidedObject(
"Final marking for " + net.getLabel(),
finalMarking, Marking.class, context);
context.addConnection(new FinalMarkingConnection(net, finalMarking));
}
-
Dear Eric,
thank you very much for the fast and again very useful reply.
Best regards,
Oliver
Howdy, Stranger!
Categories
- 1.6K All Categories
- 45 Announcements / News
- 224 Process Mining
- 6 - BPI Challenge 2020
- 9 - BPI Challenge 2019
- 24 - BPI Challenge 2018
- 27 - BPI Challenge 2017
- 8 - BPI Challenge 2016
- 68 Research
- 1K ProM 6
- 393 - Usage
- 287 - Development
- 9 RapidProM
- 1 - Usage
- 7 - Development
- 54 ProM5
- 19 - Usage
- 187 Event Logs
- 32 - ProMimport
- 75 - XESame