Exemplo n.º 1
0
        public double Distance(AbsNode destination)
        {
            var xDist = Info.X - destination.Info.X;
            var yDist = Info.Y - destination.Info.Y;

            return(Math.Sqrt(xDist * xDist + yDist * yDist));
        }
Exemplo n.º 2
0
        public double NextServiceBeginTime(AbsNode newCustomer, AbsNode prevCustomer, double prevTime)
        {
            double travelTime  = prevCustomer.TravelTime(newCustomer);
            double serviceTime = prevCustomer.Info.ServiceTime;
            double readyTime   = newCustomer.Info.ReadyTime;

            return(Math.Min(readyTime, prevTime + serviceTime + travelTime));
        }
Exemplo n.º 3
0
 public double CriterionC11(int i, AbsNode u, int j, Route route)
 {
     var custI = route.RouteList[i];
     var custJ = route.RouteList[j];
     double distIu = custI.Distance(u);
     double distUj = u.Distance(custJ);
     double distJi = custJ.Distance(custI);
     return distIu + distUj + CoefMu*distJi;
 }
Exemplo n.º 4
0
 public double CriterionC12(int i, AbsNode u, int j, Route route)
 {
     var custI = route.RouteList[i];
     var custJ = route.RouteList[j];
     double bI = route.ServiceBeginingTimes[i];
     double bU = route.NextServiceBeginTime(u, custI, bI);
     double bJu = route.NextServiceBeginTime(custJ, u, bU);
     double bJ = route.ServiceBeginingTimes[j];
     return bJu - bJ;
 }
Exemplo n.º 5
0
        private void AddNode(AbsNode newNode)
        {
            AbsNode lastCustomer    = RouteList.Count == 0 ? newNode : RouteList[RouteList.Count - 1];
            double  lastServiceTime = RouteList.Count == 0 ? 0 : ServiceBeginingTimes[ServiceBeginingTimes.Count - 1];
            double  serviceBegins   = NextServiceBeginTime(newNode, lastCustomer, lastServiceTime);

            RouteList.Add(newNode);
            ServiceBeginingTimes.Add(serviceBegins);
            UpdateId();
        }
Exemplo n.º 6
0
 public double CriterionC2(AbsNode u, double c1Value, Route route)
 {
     double d0U = route.RouteList[0].Distance(u);
     return CoefLambda*d0U - c1Value;
 }
Exemplo n.º 7
0
 public double CriterionC1(int i, AbsNode u, int j, Route route)
 {
     return CoefAlpha1*CriterionC11(i, u, i, route) + CoefAlpha2*CriterionC12(i, u, j, route);
 }
Exemplo n.º 8
0
 private void AddNode(AbsNode newNode)
 {
     AbsNode lastCustomer = RouteList.Count == 0 ? newNode : RouteList[RouteList.Count - 1];
     double lastServiceTime = RouteList.Count == 0 ? 0 : ServiceBeginingTimes[ServiceBeginingTimes.Count - 1];
     double serviceBegins = NextServiceBeginTime(newNode, lastCustomer, lastServiceTime);
     RouteList.Add(newNode);
     ServiceBeginingTimes.Add(serviceBegins);
     UpdateId();
 }
Exemplo n.º 9
0
 public double NextServiceBeginTime(AbsNode newCustomer, AbsNode prevCustomer, double prevTime)
 {
     double travelTime = prevCustomer.TravelTime(newCustomer);
     double serviceTime = prevCustomer.Info.ServiceTime;
     double readyTime = newCustomer.Info.ReadyTime;
     return Math.Min(readyTime, prevTime + serviceTime + travelTime);
 }
Exemplo n.º 10
0
 public double TravelTime(AbsNode destination)
 {
     return Distance(destination);
 }
Exemplo n.º 11
0
 public double Distance(AbsNode destination)
 {
     var xDist = Info.X - destination.Info.X;
     var yDist = Info.Y - destination.Info.Y;
     return Math.Sqrt(xDist * xDist + yDist * yDist);
 }
Exemplo n.º 12
0
 public double TravelTime(AbsNode destination)
 {
     return(Distance(destination));
 }