Exemplo n.º 1
0
 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);
     }));
 }
Exemplo n.º 2
0
 internal void AddIncoming(BaseNode node)
 {
     Incoming.Add(new NodeLink(node)
     {
         Weight = Helpers.GetRandomWeight()
     });
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
 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);
     }));
 }
Exemplo n.º 6
0
 public void AddIncoming(int num)
 {
     Incoming.Add(num);
 }