Package rinde.sim.pdptw.generator.tw

Examples of rinde.sim.pdptw.generator.tw.ProportionateUniformTWGenerator


  public void test() {
    final long serviceTime = 5;
    final long endTime = 180;
    final Point depotLocation = new Point(5, 5);
    final double vehicleSpeed = 40;
    final ProportionateUniformTWGenerator twg = new ProportionateUniformTWGenerator(
        depotLocation, endTime, serviceTime, 30, vehicleSpeed);
    final RandomGenerator rng = new MersenneTwister(123);
    for (int i = 0; i < 10000; i++) {
      final Point p1 = new Point(6, 6);
      final Point p2 = new Point(4, 4);
      final List<TimeWindow> tws = twg.generate(DoubleMath.roundToLong(rng
          .nextDouble() * 120, RoundingMode.HALF_DOWN), p1, p2, rng);
      assertTrue(tws.toString(), tws.get(0).end <= tws.get(1).end
          + travelTime(p1, p2, vehicleSpeed) + serviceTime);
      assertTrue(tws.toString() + " tt: " + travelTime(p1, p2, vehicleSpeed), tws.get(0).begin
          + travelTime(p1, p2, vehicleSpeed) + serviceTime <= tws.get(1).begin);
View Full Code Here


      }
      locationsGenerator =
          new NormalLocationsGenerator(size, .15, .05);
      if (timeWindowGenerator == null) {
        timeWindowGenerator =
            new ProportionateUniformTWGenerator(depotLocation,
                scenarioLength,
                serviceTime * 60000, minimumResponseTime * 60000, vehicleSpeed);
      }
      vehicleGenerator = new HomogenousVehicleGenerator(vehicles, vehicleDto);

View Full Code Here

TOP

Related Classes of rinde.sim.pdptw.generator.tw.ProportionateUniformTWGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.