本文整理汇总了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;未经允许,请勿转载。 |
请发表评论