• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# PSharp.MachineId类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Microsoft.PSharp.MachineId的典型用法代码示例。如果您正苦于以下问题:C# MachineId类的具体用法?C# MachineId怎么用?C# MachineId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MachineId类属于Microsoft.PSharp命名空间,在下文中一共展示了MachineId类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ConfigureEvent

 public ConfigureEvent(int id, MachineId[] servers, MachineId manager)
     : base()
 {
     this.Id = id;
     this.Servers = servers;
     this.ClusterManager = manager;
 }
开发者ID:huangpf,项目名称:PSharp,代码行数:7,代码来源:Server.cs


示例2: EventOriginInfo

 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="senderMachineId">Sender machine id</param>
 /// <param name="senderMachineName">Sender machine name</param>
 /// <param name="senderStateName">Sender state name</param>
 internal EventOriginInfo(MachineId senderMachineId, string senderMachineName,
     string senderStateName)
 {
     this.SenderMachineId = senderMachineId;
     this.SenderMachineName = senderMachineName;
     this.SenderStateName = senderStateName;
 }
开发者ID:yonglehou,项目名称:PSharp,代码行数:13,代码来源:EventOriginInfo.cs


示例3: ConfigureEvent

 public ConfigureEvent(MachineId env, MachineId manager, int id)
     : base()
 {
     this.Environment = env;
     this.NodeManager = manager;
     this.Id = id;
 }
开发者ID:huangpf,项目名称:PSharp,代码行数:7,代码来源:StorageNode.cs


示例4: SentLog

 public SentLog(int nextSeqId, MachineId client, int key, int val)
 {
     this.NextSeqId = nextSeqId;
     this.Client = client;
     this.Key = key;
     this.Value = val;
 }
开发者ID:yonglehou,项目名称:PSharp,代码行数:7,代码来源:SentLog.cs


示例5: Config

 public Config(List<MachineId> servers, MachineId parentServer, int myRank)
     : base(-1, -1)
 {
     this.Servers = servers;
     this.ParentServer = parentServer;
     this.MyRank = myRank;
 }
开发者ID:huangpf,项目名称:PSharp,代码行数:7,代码来源:LeaderElection.cs


示例6: Prepare

 public Prepare(MachineId id, int nextSlot, Tuple<int, int> nextProposal, int myRank)
     : base(-1, -1)
 {
     this.Node = id;
     this.NextSlotForProposer = nextSlot;
     this.NextProposal = nextProposal;
     this.MyRank = myRank;
 }
开发者ID:huangpf,项目名称:PSharp,代码行数:8,代码来源:PaxosNode.cs


示例7: VoteRequest

            public int LastLogTerm; // term of candidate’s last log entry

            public VoteRequest(int term, MachineId candidateId, int lastLogIndex, int lastLogTerm)
                : base()
            {
                this.Term = term;
                this.CandidateId = candidateId;
                this.LastLogIndex = lastLogIndex;
                this.LastLogTerm = lastLogTerm;
            }
开发者ID:huangpf,项目名称:PSharp,代码行数:10,代码来源:Server.cs


示例8: monitor_valueChosen

 public monitor_valueChosen(MachineId id, int nextSlot, Tuple<int, int> nextProposal, int proposeVal)
     : base(-1, -1)
 {
     this.Node = id;
     this.NextSlotForProposer = nextSlot;
     this.NextProposal = nextProposal;
     this.ProposeVal = proposeVal;
 }
开发者ID:huangpf,项目名称:PSharp,代码行数:8,代码来源:BasicPaxosInvariant_P2b.cs


示例9: AppendEntriesRequest

            public MachineId ReceiverEndpoint; // client

            public AppendEntriesRequest(int term, MachineId leaderId, int prevLogIndex,
                int prevLogTerm, List<Log> entries, int leaderCommit, MachineId client)
                : base()
            {
                this.Term = term;
                this.LeaderId = leaderId;
                this.PrevLogIndex = prevLogIndex;
                this.PrevLogTerm = prevLogTerm;
                this.Entries = entries;
                this.LeaderCommit = leaderCommit;
                this.ReceiverEndpoint = client;
            }
开发者ID:huangpf,项目名称:PSharp,代码行数:14,代码来源:Server.cs


示例10: InitOnEntry

        void InitOnEntry()
        {
            this.Servers = (this.Payload as object[])[0] as List<MachineId>;
            this.ParentServer = (this.Payload as object[])[1] as MachineId;
            this.MyRank = (int)(this.Payload as object[])[2];

            this.CurrentLeader = Tuple.Create(this.MyRank, this.Id);

            this.CommunicateLeaderTimeout = this.CreateMachine(typeof(Timer), this.Id, 100);
            this.BroadCastTimeout = this.CreateMachine(typeof(Timer), this.Id, 10);

            this.Raise(new local());
        }
开发者ID:jerickmsft,项目名称:PSharp,代码行数:13,代码来源:LeaderElection.cs


示例11: InitOnEntry

        void InitOnEntry()
        {
            this.PaxosNodes = new List<MachineId>();

            this.PaxosNodes.Insert(0, this.CreateMachine(typeof(PaxosNode), 3));
            this.PaxosNodes.Insert(0, this.CreateMachine(typeof(PaxosNode), 2));
            this.PaxosNodes.Insert(0, this.CreateMachine(typeof(PaxosNode), 1));

            foreach (var node in this.PaxosNodes)
            {
                this.Send(node, new allNodes(), this.PaxosNodes);
            }

            this.Client = this.CreateMachine(typeof(Client), this.PaxosNodes);
        }
开发者ID:jerickmsft,项目名称:PSharp,代码行数:15,代码来源:GodMachine.cs


示例12: Configure

		void Configure()
        {
            this.Environment = (this.ReceivedEvent as Events.NodeManagerConfigEvent).env_id;
            this.DataNodeMachines = new List<MachineId>();

            for (int idx = 0; idx < 3; idx++)
            {
                this.DataNodeMachines.Add(this.CreateMachine(typeof(DataNodeMachine)));
            }
            
            this.NodeManager = new NodeManagerWrapper(this.DataNodeMachines);

            this.Send(this.Environment, new Events.ConfigAckEvent(this.DataNodeMachines));
            this.Raise(new Events.UnitEvent());
        }
开发者ID:huangpf,项目名称:PSharp,代码行数:15,代码来源:NodeManagerMachine.cs


示例13: EntryOnInit

        void EntryOnInit()
        {
            this.NumberOfServers = 5;
            this.LeaderTerm = 0;

            this.Servers = new MachineId[this.NumberOfServers];

            for (int idx = 0; idx < this.NumberOfServers; idx++)
            {
                this.Servers[idx] = this.CreateMachine(typeof(Server));
            }

            this.Client = this.CreateMachine(typeof(Client));

            this.Raise(new LocalEvent());
        }
开发者ID:yonglehou,项目名称:PSharp,代码行数:16,代码来源:ClusterManager.cs


示例14: EntryOnInit

        void EntryOnInit()
        {
            this.NumberOfReplicas = 3;
            this.NumberOfFaults = 1;
            this.AliveNodes = new List<MachineId>();

            this.Monitor<LivenessMonitor>(new LivenessMonitor.ConfigureEvent(this.NumberOfReplicas));

            this.NodeManager = this.CreateMachine(typeof(NodeManager));
            this.Client = this.CreateMachine(typeof(Client));

            this.FailureTimer = this.CreateMachine(typeof(FailureTimer));
            this.Send(this.FailureTimer, new FailureTimer.ConfigureEvent(this.Id));

            this.Raise(new LocalEvent());
        }
开发者ID:yonglehou,项目名称:PSharp,代码行数:16,代码来源:Environment.cs


示例15: Configure

        void Configure()
        {
            this.Nodes = new List<MachineId>();
            this.Clients = new Dictionary<MachineId, bool>();
            this.Alive = new Dictionary<MachineId, bool>();
            this.Responses = new Dictionary<MachineId, bool>();

            this.Nodes = (this.ReceivedEvent as Config).Nodes;
            foreach (var node in this.Nodes)
            {
                this.Alive.Add(node, true);
            }

            this.Timer = this.CreateMachine(typeof(Timer));
            this.Send(this.Timer, new Timer.Config(this.Id));

            this.Raise(new Unit());
        }
开发者ID:yonglehou,项目名称:PSharp,代码行数:18,代码来源:FailureDetector.cs


示例16: Configure

        void Configure()
        {
            this.NodeId = (this.ReceivedEvent as Config).Id;
            this.Keys = (this.ReceivedEvent as Config).Keys;
            this.Manager = (this.ReceivedEvent as Config).Manager;

            var nodes = (this.ReceivedEvent as Config).Nodes;
            var nodeIds = (this.ReceivedEvent as Config).NodeIds;

            this.NumOfIds = (int)Math.Pow(2, nodes.Count);

            for (var idx = 1; idx <= nodes.Count; idx++)
            {
                var start = (this.NodeId + (int)Math.Pow(2, (idx - 1))) % this.NumOfIds;
                var end = (this.NodeId + (int)Math.Pow(2, idx)) % this.NumOfIds;

                var nodeId = this.GetSuccessorNodeId(start, nodeIds);
                this.FingerTable.Add(start, new Finger(start, end, nodes[nodeId]));
            }

            for (var idx = 0; idx < nodeIds.Count; idx++)
            {
                if (nodeIds[idx] == this.NodeId)
                {
                    this.Predecessor = nodes[this.WrapSubtract(idx, 1, nodeIds.Count)];
                    break;
                }
            }

            this.Raise(new Local());
        }
开发者ID:yonglehou,项目名称:PSharp,代码行数:31,代码来源:ChordNode.cs


示例17: InitOnEntry

        void InitOnEntry()
        {
            this.Bank = this.CreateMachine(typeof(Bank), new Bank.Config(this.Id));
            this.ATM = this.CreateMachine(typeof(ATM), new ATM.Config(this.Bank));

            this.Goto(typeof(Test1));
        }
开发者ID:yonglehou,项目名称:PSharp,代码行数:7,代码来源:Driver.cs


示例18: DoHook

        void DoHook()
        {
            var creature = (this.ReceivedEvent as Hook).Creature;
            var colour = (this.ReceivedEvent as Hook).Colour;

            if (this.TotalRendezvous == 0)
            {
                this.TotalStoppedCreatures++;
                this.DoPostRoundProcessing();
                return;
            }

            if (this.FirstHooker == null)
            {
                this.FirstHooker = creature;
                this.FirstColour = colour;
            }
            else
            {
                this.Send(this.FirstHooker, new Hook(creature, colour));
                this.Send(creature, new Hook(this.FirstHooker, this.FirstColour));
                this.FirstHooker = null;
                this.TotalRendezvous = this.TotalRendezvous - 1;
            }
        }
开发者ID:yonglehou,项目名称:PSharp,代码行数:25,代码来源:Broker.cs


示例19: ProcessBecomeHead

        void ProcessBecomeHead()
        {
            this.IsHead = true;
            this.Predecessor = this.Id;

            var target = (this.ReceivedEvent as ChainReplicationMaster.BecomeHead).Target;
            this.Send(target, new ChainReplicationMaster.HeadChanged());
        }
开发者ID:yonglehou,项目名称:PSharp,代码行数:8,代码来源:ChainReplicationServer.cs


示例20: Configure

        void Configure()
        {
            this.ProcessId = (this.ReceivedEvent as Config).Id;
            this.RightProcess = (this.ReceivedEvent as Config).RightProcess;
            this.MaxProcessId = this.ProcessId;
            this.IsActive = true;

            this.Goto(typeof(Active));
        }
开发者ID:yonglehou,项目名称:PSharp,代码行数:9,代码来源:LeaderElectionProcess.cs



注:本文中的Microsoft.PSharp.MachineId类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Parsing.PSharpLexer类代码示例发布时间:2022-05-26
下一篇:
C# OAuth.OAuthValidateClientRedirectUriContext类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap