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)); }
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)); }
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; }
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; }
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(); }
public double CriterionC2(AbsNode u, double c1Value, Route route) { double d0U = route.RouteList[0].Distance(u); return CoefLambda*d0U - c1Value; }
public double CriterionC1(int i, AbsNode u, int j, Route route) { return CoefAlpha1*CriterionC11(i, u, i, route) + CoefAlpha2*CriterionC12(i, u, j, route); }
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); }
public double TravelTime(AbsNode destination) { return Distance(destination); }
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); }
public double TravelTime(AbsNode destination) { return(Distance(destination)); }