コード例 #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));
 }
コード例 #2
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(LivenessMonitor));
     runtime.CreateMachine(typeof(Environment));
     runtime.Wait();
     Console.WriteLine("Done!");
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: cephdon/PSharpModels
 public static void Execute(PSharpRuntime runtime)
 {
     ActorModel.Start(runtime, () =>
     {
         runtime.RegisterMonitor(typeof(SafetyMonitor));
         var senderProxy = ActorProxy.Create <IDriver>(new ActorId(0), "DriverProxy");
     });
 }
コード例 #4
0
ファイル: Program.cs プロジェクト: cephdon/PSharpModels
        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();
            });
        }
コード例 #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);
        }
コード例 #6
0
ファイル: Test.cs プロジェクト: rekoder/PSharp
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(Safety));
     runtime.CreateMachine(typeof(Driver));
 }
コード例 #7
0
ファイル: Test.cs プロジェクト: yonglehou/PSharp
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(ValMachineCheck));
     runtime.CreateMachine(typeof(GodMachine));
 }
コード例 #8
0
ファイル: Test.cs プロジェクト: rekoder/PSharp
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(ValidityCheck));
     runtime.CreateMachine(typeof(GodMachine));
 }
コード例 #9
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(LivenessMonitor));
     runtime.CreateMachine(typeof(Environment));
 }
コード例 #10
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(WatchDog));
     runtime.CreateMachine(typeof(EventHandler));
 }
コード例 #11
0
ファイル: Test.cs プロジェクト: yonglehou/PSharp
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(InvariantMonitor));
     runtime.RegisterMonitor(typeof(ServerResponseSeqMonitor));
     runtime.CreateMachine(typeof(Environment));
 }
コード例 #12
0
ファイル: WarmStateBugTest.cs プロジェクト: yonglehou/PSharp
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(WatchDog));
     runtime.CreateMachine(typeof(EventHandler));
 }
コード例 #13
0
ファイル: Test.cs プロジェクト: yonglehou/PSharp
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(M));
     runtime.CreateMachine(typeof(Environment));
 }
コード例 #14
0
ファイル: Test.cs プロジェクト: yonglehou/PSharp
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(SafetyMonitor));
     runtime.CreateMachine(typeof(ClusterManager));
 }
コード例 #15
0
 public static void PaxosTest(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(SafteyAndLivenessMonitor));
     runtime.CreateMachine(typeof(MainMachine), new MainMachineInitEvent(runtime));
 }
コード例 #16
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(M));
     runtime.CreateMachine(typeof(Real1));
 }
コード例 #17
0
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(LivenessMonitor));
     runtime.CreateMachine(typeof(M));
 }
コード例 #18
0
ファイル: Test.cs プロジェクト: suriyak/PSharp
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(LivenessMonitor));
     runtime.CreateMachine(typeof(ClusterManager));
 }
コード例 #19
0
ファイル: Test.cs プロジェクト: suriyak/PSharp
 public static void Execute(PSharpRuntime runtime)
 {
     runtime.RegisterMonitor(typeof(InvariantMonitor));
     runtime.RegisterMonitor(typeof(ServerResponseSeqMonitor));
     runtime.CreateMachine(typeof(Environment));
 }