public override Task AppendLoad(XElement item, Process target) { return(Task.Run(() => { // 中间流对象拥有前后连接 var ins = item.Elements("incoming"); foreach (var @in in ins) { if (Incoming == null) { Incoming = new List <SequenceFlow>(); } Incoming.Add(target.Where(a => a.Id == @in.Value).FirstOrDefault() as SequenceFlow); } var outs = item.Elements("outgoing"); foreach (var @out in outs) { if (Outgoing == null) { Outgoing = new List <SequenceFlow>(); } Outgoing.Add(target.Where(a => a.Id == @out.Value).FirstOrDefault() as SequenceFlow); } ProcessRef = target; Executor.Init(this, item, Executor.TypesAll); })); }
internal void AddIncoming(BaseNode node) { Incoming.Add(new NodeLink(node) { Weight = Helpers.GetRandomWeight() }); }
public bool AddTrip(TransitFlight trip) { if (TripsCount >= MaxTrips - trip.tripsInfo.Count) { return(false); } if (this == trip.From) { Outgoing.Add(trip); } else if (this == trip.To) { Incoming.Add(trip); } return(true); }
public bool AddTrip(Trip trip) { if (TripsCount >= MaxTrips) { return(false); } if (this == trip.From) { Outgoing.Add(trip); } else if (this == trip.To) { Incoming.Add(trip); } return(true); }
public override Task AppendLoad(XElement item, Process target) { return(Task.Run(() => { // 结束事件拥有前连接 var ins = item.Elements("incoming"); foreach (var @in in ins) { if (Incoming == null) { Incoming = new List <Connection>(); } Incoming.Add(target.Where(a => a.Id == @in.Value).FirstOrDefault() as Connection); } ProcessRef = target; Executor.Init(this, item, Executor.TypesAll); })); }
public void AddIncoming(int num) { Incoming.Add(num); }