Esempio n. 1
0
 public static void Execute(PSharpRuntime runtime)
 {
     // Monitors must be registered before the first P# machine
     // gets created (which will kickstart the runtime).
     runtime.RegisterMonitor(typeof(Safety));
     runtime.RegisterMonitor(typeof(Liveness));
     runtime.CreateMachine(typeof(Driver), new Driver.Config(2));
 }
Esempio n. 2
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(LivenessMonitor));
     runtime.CreateMachine(typeof(Environment));
     runtime.Wait();
     Console.WriteLine("Done!");
 }
Esempio n. 3
0
 public static void Execute(PSharpRuntime runtime)
 {
     ActorModel.Start(runtime, () =>
     {
         runtime.RegisterMonitor(typeof(SafetyMonitor));
         var senderProxy = ActorProxy.Create <IDriver>(new ActorId(0), "DriverProxy");
     });
 }
Esempio n. 4
0
        public static void Execute(PSharpRuntime runtime)
        {
            //Configuration conf = Configuration.Create(true, true, true, true, true);
            //ActorModel.Configure(conf);

            ActorModel.Start(runtime, () =>
            {
                var config = ClientConfiguration.LocalhostSilo();
                GrainClient.Initialize(config);

                runtime.RegisterMonitor(typeof(SafetyMonitor));

                var clusterManager = GrainClient.GrainFactory.GetGrain <IClusterManager>(0);
                clusterManager.Configure();
            });
        }
Esempio n. 5
0
        public static MonitorId NewMonitor(this PSharpRuntime @this, Type type, Event e)
        {
            if (@this == null)
            {
                throw new ArgumentNullException(nameof(@this));
            }

            var monitorId = new MonitorId(@this, type);

            if (!GetRegisteredMonitors(@this).TryAdd(monitorId, null))
            {
                return(monitorId);
            }

            ms_extProps.GetOrCreateValue(@this).LastCreatedMonitorId = monitorId;
            @this.RegisterMonitor(type);
            if (e != null)
            {
                @this.InvokeMonitor(monitorId, e);
            }
            return(monitorId);
        }
Esempio n. 6
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(Safety));
     runtime.CreateMachine(typeof(Driver));
 }
Esempio n. 7
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(ValMachineCheck));
     runtime.CreateMachine(typeof(GodMachine));
 }
Esempio n. 8
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(ValidityCheck));
     runtime.CreateMachine(typeof(GodMachine));
 }
Esempio n. 9
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(LivenessMonitor));
     runtime.CreateMachine(typeof(Environment));
 }
Esempio n. 10
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(WatchDog));
     runtime.CreateMachine(typeof(EventHandler));
 }
Esempio n. 11
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(InvariantMonitor));
     runtime.RegisterMonitor(typeof(ServerResponseSeqMonitor));
     runtime.CreateMachine(typeof(Environment));
 }
Esempio n. 12
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(WatchDog));
     runtime.CreateMachine(typeof(EventHandler));
 }
Esempio n. 13
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(M));
     runtime.CreateMachine(typeof(Environment));
 }
Esempio n. 14
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(SafetyMonitor));
     runtime.CreateMachine(typeof(ClusterManager));
 }
Esempio n. 15
0
 public static void PaxosTest(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(SafteyAndLivenessMonitor));
     runtime.CreateMachine(typeof(MainMachine), new MainMachineInitEvent(runtime));
 }
Esempio n. 16
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(M));
     runtime.CreateMachine(typeof(Real1));
 }
Esempio n. 17
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(LivenessMonitor));
     runtime.CreateMachine(typeof(M));
 }
Esempio n. 18
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(LivenessMonitor));
     runtime.CreateMachine(typeof(ClusterManager));
 }
Esempio n. 19
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(InvariantMonitor));
     runtime.RegisterMonitor(typeof(ServerResponseSeqMonitor));
     runtime.CreateMachine(typeof(Environment));
 }