Пример #1
0
 private void btnExecute_Click(object sender, EventArgs e)
 {
     var petriNet = petriNetEditor.ExportToPetriNet();
     var verificationResult = new PetriNetSoundnessVerifier().Verify(new PetriNetVerificationContext { PetriNet = petriNet });
     var runtimeHost = new EmbeddedRuntimeHost(typeof(PetrifierRuntime));
     runtimeHost.ExecutePetriNetModule(new PetriNetModule(petriNet));
 }
Пример #2
0
        public static void ExecutePetriNet(string fileName)
        {
            var document = new PnmlDocument();
            document.Load(File.ReadAllText(fileName));
            var petriNet = new PnmlPersister().Import(document);

            var runtimeHost = new EmbeddedRuntimeHost(typeof(PetrifierRuntime));
            var handle = runtimeHost.ExecutePetriNetModule(new PetriNetModule(petriNet));
            runtimeHost.WaitForEnd(handle);
        }