예제 #1
0
파일: Problem.cs 프로젝트: zhrsama/vrptw
        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));
        }
예제 #2
0
파일: Solution.cs 프로젝트: zhrsama/vrptw
        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));
        }
예제 #3
0
파일: Solomon87.cs 프로젝트: zaycev/vrptw
 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;
 }
예제 #4
0
파일: Solomon87.cs 프로젝트: zaycev/vrptw
 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;
 }
예제 #5
0
파일: Solution.cs 프로젝트: zhrsama/vrptw
        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();
        }
예제 #6
0
파일: Solomon87.cs 프로젝트: zaycev/vrptw
 public double CriterionC2(AbsNode u, double c1Value, Route route)
 {
     double d0U = route.RouteList[0].Distance(u);
     return CoefLambda*d0U - c1Value;
 }
예제 #7
0
파일: Solomon87.cs 프로젝트: zaycev/vrptw
 public double CriterionC1(int i, AbsNode u, int j, Route route)
 {
     return CoefAlpha1*CriterionC11(i, u, i, route) + CoefAlpha2*CriterionC12(i, u, j, route);
 }
예제 #8
0
파일: Solution.cs 프로젝트: zaycev/vrptw
 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();
 }
예제 #9
0
파일: Solution.cs 프로젝트: zaycev/vrptw
 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);
 }
예제 #10
0
파일: Problem.cs 프로젝트: zaycev/vrptw
 public double TravelTime(AbsNode destination)
 {
     return Distance(destination);
 }
예제 #11
0
파일: Problem.cs 프로젝트: zaycev/vrptw
 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);
 }
예제 #12
0
파일: Problem.cs 프로젝트: zhrsama/vrptw
 public double TravelTime(AbsNode destination)
 {
     return(Distance(destination));
 }