1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

make string ruin configurable

This commit is contained in:
oblonski 2017-04-26 15:05:28 +02:00
parent 933e2ca120
commit 5d56d2e091
No known key found for this signature in database
GPG key ID: 179DE487285680D1
2 changed files with 29 additions and 2 deletions

View file

@ -121,7 +121,12 @@ public class Jsprit {
FAST_REGRET("regret.fast"),
MAX_TRANSPORT_COSTS("max_transport_costs"),
CONSTRUCTION("construction"),
BREAK_SCHEDULING("break_scheduling");
BREAK_SCHEDULING("break_scheduling"),
STRING_KMIN("string_kmin"),
STRING_KMAX("string_kmax"),
STRING_LMIN("string_lmin"),
STRING_LMAX("string_lmax");
String paraName;
@ -184,10 +189,17 @@ public class Jsprit {
defaults.put(Strategy.STRING_BEST.toString(), ".5");
defaults.put(Strategy.STRING_REGRET.toString(), ".5");
defaults.put(Parameter.STRING_KMIN.toString(), "1");
defaults.put(Parameter.STRING_KMAX.toString(), "6");
defaults.put(Parameter.STRING_LMIN.toString(), "10");
defaults.put(Parameter.STRING_LMAX.toString(), "30");
defaults.put(Strategy.WORST_BEST.toString(), "0.");
defaults.put(Strategy.WORST_REGRET.toString(), "1.");
defaults.put(Strategy.CLUSTER_BEST.toString(), "0.");
defaults.put(Strategy.CLUSTER_REGRET.toString(), "1.");
defaults.put(Parameter.FIXED_COST_PARAM.toString(), "0.");
defaults.put(Parameter.VEHICLE_SWITCH.toString(), "true");
defaults.put(Parameter.ITERATIONS.toString(), "2000");
@ -478,7 +490,11 @@ public class Jsprit {
random)
);
final RuinString stringRuin = new RuinString(vrp, jobNeighborhoods);
int kmin = toInteger(properties.getProperty(Parameter.STRING_KMIN.toString()));
int kmax = toInteger(properties.getProperty(Parameter.STRING_KMAX.toString()));
int lmin = toInteger(properties.getProperty(Parameter.STRING_LMIN.toString()));
int lmax = toInteger(properties.getProperty(Parameter.STRING_LMAX.toString()));
final RuinString stringRuin = new RuinString(vrp, jobNeighborhoods, kmin, kmax, lmin, lmax);
stringRuin.setRandom(random);
AbstractInsertionStrategy regret;

View file

@ -92,6 +92,17 @@ public final class RuinString extends AbstractRuinStrategy {
logger.debug("initialise {}", this);
}
public RuinString(VehicleRoutingProblem vrp, JobNeighborhoods jobNeighborhoods, int Kmin, int Kmax, int Lmin, int Lmax) {
super(vrp);
this.vrp = vrp;
this.jobNeighborhoods = jobNeighborhoods;
this.Kmin = Kmin;
this.Kmax = Kmax;
this.Lmin = Lmin;
this.Lmax = Lmax;
logger.debug("initialise {}", this);
}
@Override
public String toString() {
return "[name=splitRuin]";