本文整理汇总了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;
}
示例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;
}
示例3: ConfigureEvent
public ConfigureEvent(MachineId env, MachineId manager, int id)
: base()
{
this.Environment = env;
this.NodeManager = manager;
this.Id = id;
}
示例4: SentLog
public SentLog(int nextSeqId, MachineId client, int key, int val)
{
this.NextSeqId = nextSeqId;
this.Client = client;
this.Key = key;
this.Value = val;
}
示例5: Config
public Config(List<MachineId> servers, MachineId parentServer, int myRank)
: base(-1, -1)
{
this.Servers = servers;
this.ParentServer = parentServer;
this.MyRank = myRank;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}
示例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());
}
示例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));
}
示例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;
}
}
示例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());
}
示例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));
}