Exemplo 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));
 }
Exemplo n.º 2
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(LivenessMonitor));
     runtime.CreateMachine(typeof(Environment));
     runtime.Wait();
     Console.WriteLine("Done!");
 }
Exemplo 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");
     });
 }
Exemplo 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();
            });
        }
Exemplo 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);
        }
Exemplo n.º 6
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(Safety));
     runtime.CreateMachine(typeof(Driver));
 }
Exemplo n.º 7
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(ValMachineCheck));
     runtime.CreateMachine(typeof(GodMachine));
 }
Exemplo n.º 8
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(ValidityCheck));
     runtime.CreateMachine(typeof(GodMachine));
 }
Exemplo n.º 9
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(LivenessMonitor));
     runtime.CreateMachine(typeof(Environment));
 }
Exemplo n.º 10
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(WatchDog));
     runtime.CreateMachine(typeof(EventHandler));
 }
Exemplo n.º 11
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(InvariantMonitor));
     runtime.RegisterMonitor(typeof(ServerResponseSeqMonitor));
     runtime.CreateMachine(typeof(Environment));
 }
Exemplo n.º 12
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(WatchDog));
     runtime.CreateMachine(typeof(EventHandler));
 }
Exemplo n.º 13
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(M));
     runtime.CreateMachine(typeof(Environment));
 }
Exemplo n.º 14
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(SafetyMonitor));
     runtime.CreateMachine(typeof(ClusterManager));
 }
Exemplo n.º 15
0
 public static void PaxosTest(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(SafteyAndLivenessMonitor));
     runtime.CreateMachine(typeof(MainMachine), new MainMachineInitEvent(runtime));
 }
Exemplo n.º 16
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(M));
     runtime.CreateMachine(typeof(Real1));
 }
Exemplo n.º 17
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(LivenessMonitor));
     runtime.CreateMachine(typeof(M));
 }
Exemplo n.º 18
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(LivenessMonitor));
     runtime.CreateMachine(typeof(ClusterManager));
 }
Exemplo n.º 19
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(InvariantMonitor));
     runtime.RegisterMonitor(typeof(ServerResponseSeqMonitor));
     runtime.CreateMachine(typeof(Environment));
 }