org.cpsolver.ifs.example.rpp

## Class Test

- java.lang.Object
- - org.cpsolver.ifs.example.rpp.Test

-     public class Test
      extends Object

  RPP test. It takes one argument -- property file with all the parameters. It allows to execute given number of tests. The problem is loaded from prolog-based text files. For description of RPP problem see `RPPModel`.
  Description of the input problem files can be found at http://www.fi.muni.cz/~hanka/rpp/instances.html. Each input problem (e.g., gen22.pl) has the following structure:

       objects([
         object(
           name( rect1 ),
           size( [ 2, 1 ] ),
           valid_positions( [ 0-38, 0-13 ] )
         ),
         object(
           name( rect2 ),
           size( [ 2, 1 ] ),
           valid_positions( [ 0-38, 0-13 ] )
         ),
       ...
         object(
           name( rect200 ),
           size( [ 2, 1 ] ),
           valid_positions( [ 0-38, 7-13 ] )
         )
       ] ).

  Stating that the first rectangle (named rect1) has size 2x1 and its valid position are with x between 0 and 38, y between 0 and 13, and so on.
  MPP instances contain an extra file with the solution (e.g., gen22.solution), with the following structure

       assigned([[rect1X,[17]], [rect1Y,[5]], [rect2X,[24]], [rect2Y,[4]], ... [rect200X,[37]], [rect200Y,[10]]]).

  Which means that the first rectangle (named rect1) is to be placed at [17,5], second at [24,4] and so on.
  There is also a file (e.g., gen22.mpp) describing which input placements are to be prohibited (not that if the input placement is prohibited, it means that also all values with the same X or Y coordinate are prohibited). It has the following structure:

       perturbation( 1, 0, [] ).
       perturbation( 2, 0, [] ).
       ...
       perturbation( 1, 2, [44,127] ).
       perturbation( 2, 2, [80,153] ).
       ...
       perturbation( 1, 4, [44,80,127,153] ).
       perturbation( 2, 4, [48,67,138,170] ).
       ...

  Stating that for instance in the first test with 4 perturbations the rectangles rect44, rect80, rect127 and rect153 will have their initial value prohibited.
  Test's parameters:

  Related Solver Parameters
  Parameter | Type | Comment
  --- | --- | ---
  General.MPP | `String` | Minimal perturbation problem (if true), this mj. means that initial assignment will be generated
  RPP.NrTests | `Integer` | Number of tests to be executed for each input instance
  Rpp.Min Rpp.Max Rpp.Step | `Integer` | In case of MPP: minimal, maximal number and increment of input perturbations. An instance is loaded and tested for each given number of input perturbations.
  Rpp.Min Rpp.Max | `Integer` | In case of initial problem: minimal and maximal number of the input problem. An instance is loaded and tested for each given number from RPP.Min to RPP.Max.
  Rpp.ProblemWidth Rpp.ProblemHeight | `Integer` | Width and height of the placement area.
  General.Output | `String` | Output folder where a log file and tables with results. In order not to overwrite the results if executed more than once, a subfolder with the name taken from current date and time will be created in this folder and all results will go to this subfolder.

  Also, the configuration file can consist only from one parameter (named INCLUDE_REGEXP) which is processed as a regular expression of semicolon separated list of property files, for instance

       INCLUDE_REGEXP=general.ini;{rpp85|rpp90|rpp95|mpp22}.ini;{5min}.ini;{cbs|rw1|tabu20}.ini

  where {a|b|c|...} means a selection of a, b, c, .. All possible combinations are taken and for each of them an input configuration is combined from the relevant files. So, for instance, the above example will result into the following configurations:
  - general.ini;rpp85.ini;5min.ini;cbs.ini
  - general.ini;rpp85.ini;5min.ini;rw1.ini
  - general.ini;rpp85.ini;5min.ini;tabu20.ini
  - general.ini;rpp90.ini;5min.ini;cbs.ini
  - general.ini;rpp90.ini;5min.ini;rw1.ini
  - general.ini;rpp90.ini;5min.ini;tabu20.ini
  - general.ini;rpp95.ini;5min.ini;cbs.ini
  - general.ini;rpp95.ini;5min.ini;rw1.ini
  - general.ini;rpp95.ini;5min.ini;tabu20.ini
  - general.ini;mpp22.ini;5min.ini;cbs.ini
  - general.ini;mpp22.ini;5min.ini;rw1.ini
  - general.ini;mpp22.ini;5min.ini;tabu20.ini
  To be able to distinguish such configuration a subfolder in General.Output folder is created, its name is combined from the names which are in parenthesis. So, for instance the first bunch of tests will output into the folder:

       ${General.Output}\rpp85_5min_csb\25-Feb-05_191136

  If one parameter is defined in more than one configuration files (e.g. in general.ini as well as cbs.ini) the one from the file more on the right is taken.
  An example of the configurations:
  File general.ini

       #Default settings common for all configurations
       General.MPP=false
       General.InitialAssignment=false
       General.Output=output\\RPP\\IFS

       #Value selection heuristics
       Value.Class=org.cpsolver.ifs.heuristics.GeneralValueSelection
       Value.WeightWeightedConflicts=0.0
       Value.RandomWalkProb=0.0
       Value.WeightConflicts=1.0
       Value.WeightNrAssignments=0.0
       Value.WeightValue=0.0
       Value.Tabu=0

       #Variable selection heuristics
       Variable.Class=org.cpsolver.ifs.heuristics.GeneralVariableSelection
       Variable.RandomSelection=true

       #Termination condition
       Termination.Class=org.cpsolver.ifs.termination.GeneralTerminationCondition
       Termination.MaxIters=-1
       Termination.TimeOut=-1
       Termination.StopWhenComplete=true

       #Solution comparator
       Comparator.Class=org.cpsolver.ifs.solution.GeneralSolutionComparator

  File rpp80.ini

       #RPP instances with 200 objects and the placement area filled to 80% in average
       General.Input=input\\rpp\\80
       Rpp.ProblemWidth=40
       Rpp.ProblemHeight=14
       #Use 10 problem instances (this means problem files gen1.pl, gen2.pl,... gen10.pl will be taken), each run 10 times
       Rpp.Min=1
       Rpp.Max=10
       Rpp.NrTests=10

  File mpp22.ini

       #RPP MPP instance 22 (with 200 objects and the placement area filled to 80% in average)
       #  files gen22.pl (input problem), gen22.solution (initial solution) and gen22.mpp (input perturbations) are to be taken
       General.Input=input\\rpp-mpp\\gen22
       Rpp.ProblemWidth=40
       Rpp.ProblemHeight=14
       # 0, 4, 8, .. 200 input perturbations to be used
       Rpp.Min=0
       Rpp.Max=200
       Rpp.Step=4

  File 5min.ini

       #5 minute time limit for each run
       Termination.TimeOut=300

  File cbs.ini

       #Use conflict-based statistics
       Extensions.Classes=org.cpsolver.ifs.extension.ConflictStatistics
       Value.WeightWeightedConflicts=1.0

  File tabu20.ini

       #Use tabu-list of the length 20
       Value.Tabu=20

  File rw1.ini

       #Use 1% random walk selection
       Value.RandomWalkProb=0.01

  Version:
    IFS 1.3 (Iterative Forward Search)
    Copyright (C) 2006 - 2014 Tomáš Müller
    muller@unitime.org
    http://muller.unitime.org
    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    You should have received a copy of the GNU Lesser General Public License along with this library; if not see http://www.gnu.org/licenses/.
  Author:
    Tomáš Müller
  See Also:
    `RPPModel`, `ConflictStatistics`, `GeneralValueSelection`, `GeneralVariableSelection`, `GeneralTerminationCondition`, `GeneralSolutionComparator`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Test()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `main(String[] args)` RPP test.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Test

          public Test()

  - ### Method Detail

    - #### main

          public static void main(String[] args)

      RPP test.
      Parameters:
        `args` - the command line arguments