當前位置: 首頁>>代碼示例>>C#>>正文


C# PSharp.MachineId類代碼示例

本文整理匯總了C#中Microsoft.PSharp.MachineId的典型用法代碼示例。如果您正苦於以下問題:C# MachineId類的具體用法?C# MachineId怎麽用?C# MachineId使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MachineId類屬於Microsoft.PSharp命名空間,在下文中一共展示了MachineId類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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

示例12: 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

示例13: 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

示例14: 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

示例15: 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;未經允許,請勿轉載。