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
Comments
You're almost there. The only thing left to do is to add both connections to the ProM framework:
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.
Of course, you do need a context (a PluginContext) to do this.
Kind regards,
Eric.
Note that I allow multiple final markings. The replayer can handle that.
thank you very much for the fast and again very useful reply.
Best regards,
Oliver