Package rinde.sim.pdptw.gendreau06

Examples of rinde.sim.pdptw.gendreau06.Gendreau06Test


        }
        viewBuilder.show();
      }
    };

    final Gendreau06Scenario scenario = Gendreau06Parser
        .parser().addFile(GradientFieldExample.class
            .getResourceAsStream("/data/gendreau06/req_rapide_1_240_24"),
            "req_rapide_1_240_24")
        .allowDiversion()
        .parse().get(0);
View Full Code Here


   * solver.
   * @throws IOException In case file loading fails.
   */
  @Test
  public void testOffline() throws IOException {
    final Gendreau06Scenario scenario = Gendreau06Parser.parser()
        .addFile("files/test/gendreau06/req_rapide_1_240_24")
        .offline()
        .parse()
        .get(0);

    final RandomGenerator rng = new MersenneTwister(123);
    for (int i = 0; i < 5; i++) {
      final long seed = rng.nextLong();
      final DebugSolverCreator dsc = new DebugSolverCreator(seed,
          scenario.getTimeUnit());
      final Gendreau06ObjectiveFunction obj = new Gendreau06ObjectiveFunction();
      final ExperimentResults results = Experiment.build(obj)
          .addConfiguration(Central.solverConfiguration(dsc))
          .addScenario(scenario).perform();
      assertEquals(1, results.results.size());
      assertEquals(1, dsc.arraysSolver.getInputs().size());
      assertEquals(1, dsc.arraysSolver.getOutputs().size());

      final SolutionObject[] sols = dsc.arraysSolver.getOutputs().get(0);
      int objVal = 0;
      for (final SolutionObject sol : sols) {
        objVal += sol.objectiveValue;
      }

      // convert the objective values computed by the solver to the unit of the
      // gendreau benchmark (minutes).
      final UnitConverter converter = scenario.getTimeUnit().getConverterTo(
          NonSI.MINUTE);
      final double objValInMinutes = converter.convert(objVal);

      final GlobalStateObject solverInput = dsc.solver.getInputs().get(0);
      final ImmutableList<ImmutableList<ParcelDTO>> solverOutput = dsc.solver
View Full Code Here

   * @throws IOException When file loading fails.
   */
  @Test
  public void testOnline() throws IOException {

    final Gendreau06Scenario scenario = Gendreau06Parser
        .parse(new File("files/test/gendreau06/req_rapide_1_240_24"));

    final DebugSolverCreator dsc = new DebugSolverCreator(123,
        scenario.getTimeUnit());

    final Gendreau06ObjectiveFunction obj = new Gendreau06ObjectiveFunction();
    Experiment.build(obj).addConfiguration(Central.solverConfiguration(dsc))
        .addScenario(scenario).repeat(10).perform();

View Full Code Here

  /**
   * Tests whether the SolverConfigurator works.
   */
  @Test
  public void testConfigurator() {
    final Gendreau06Scenario scenario = Gendreau06Parser.parse(
        new File("files/test/gendreau06/req_rapide_1_240_24"));

    final SupplierRng<Solver> s = new SupplierRng<Solver>() {
      @Override
      public Solver get(long seed) {
        return SolverValidator.wrap(new MultiVehicleSolverAdapter(
            ArraysSolverValidator.wrap(new RandomMVArraysSolver(
                new MersenneTwister(seed))), scenario.getTimeUnit()));
      }
    };
    final Experiment.Builder builder = Experiment
        .build(new Gendreau06ObjectiveFunction()) //
        .addScenario(scenario) //
View Full Code Here

        null);
  }

  @Test
  public void test() {
    final Gendreau06Scenario scenario = Gendreau06Parser.parse(
        new File("files/test/gendreau06/req_rapide_1_240_24"));

    final Experiment.Builder builder = Experiment
        .build(new Gendreau06ObjectiveFunction())
        .addScenario(scenario)
View Full Code Here

  /**
   * Checks whether the ordering of results is as expected.
   */
  @Test
  public void multiThreadedOrder() {
    final Gendreau06Scenario scenario = Gendreau06Parser.parse(
        new File("files/test/gendreau06/req_rapide_1_240_24"));

    final Experiment.Builder builder = Experiment
        .build(new Gendreau06ObjectiveFunction())
        .addScenario(scenario)
View Full Code Here

TOP

Related Classes of rinde.sim.pdptw.gendreau06.Gendreau06Test

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.