mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
mod test
This commit is contained in:
parent
2011501beb
commit
844f2e1e1b
1 changed files with 20 additions and 13 deletions
|
|
@ -6,6 +6,7 @@ import static org.junit.Assert.assertTrue;
|
|||
import jsprit.core.problem.VehicleRoutingProblem;
|
||||
import jsprit.core.problem.job.Job;
|
||||
import jsprit.core.problem.job.Service;
|
||||
import jsprit.core.problem.vehicle.PenaltyVehicleType;
|
||||
import jsprit.core.problem.vehicle.Vehicle;
|
||||
import jsprit.core.util.Coordinate;
|
||||
import jsprit.instance.reader.VrphGoldenReader.VrphType;
|
||||
|
|
@ -20,7 +21,13 @@ public class GoldenReaderTest {
|
|||
new VrphGoldenReader(vrpBuilder, VrphType.HVRPD)
|
||||
.read(this.getClass().getClassLoader().getResource("cn_13mix.txt").getPath());
|
||||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
assertEquals(17,vrp.getVehicles().size());
|
||||
int nuOfVehicles = 0;
|
||||
for(Vehicle v : vrp.getVehicles()){
|
||||
if(!(v.getType() instanceof PenaltyVehicleType)){
|
||||
nuOfVehicles++;
|
||||
}
|
||||
}
|
||||
assertEquals(17,nuOfVehicles);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -31,7 +38,7 @@ public class GoldenReaderTest {
|
|||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
int nuOfType1Vehicles = 0;
|
||||
for(Vehicle v : vrp.getVehicles()){
|
||||
if(v.getType().getTypeId().equals("type_1")){
|
||||
if(v.getType().getTypeId().equals("type_1") && !(v.getType() instanceof PenaltyVehicleType) ){
|
||||
nuOfType1Vehicles++;
|
||||
}
|
||||
}
|
||||
|
|
@ -46,7 +53,7 @@ public class GoldenReaderTest {
|
|||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
int sumOfType1Cap = 0;
|
||||
for(Vehicle v : vrp.getVehicles()){
|
||||
if(v.getType().getTypeId().equals("type_1")){
|
||||
if(v.getType().getTypeId().equals("type_1") && !(v.getType() instanceof PenaltyVehicleType) ){
|
||||
sumOfType1Cap+=v.getCapacity();
|
||||
}
|
||||
}
|
||||
|
|
@ -61,7 +68,7 @@ public class GoldenReaderTest {
|
|||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
int nuOfType1Vehicles = 0;
|
||||
for(Vehicle v : vrp.getVehicles()){
|
||||
if(v.getType().getTypeId().equals("type_2")){
|
||||
if(v.getType().getTypeId().equals("type_2") && !(v.getType() instanceof PenaltyVehicleType) ){
|
||||
nuOfType1Vehicles++;
|
||||
}
|
||||
}
|
||||
|
|
@ -76,7 +83,7 @@ public class GoldenReaderTest {
|
|||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
int sumOfType1Cap = 0;
|
||||
for(Vehicle v : vrp.getVehicles()){
|
||||
if(v.getType().getTypeId().equals("type_2")){
|
||||
if(v.getType().getTypeId().equals("type_2") && !(v.getType() instanceof PenaltyVehicleType) ){
|
||||
sumOfType1Cap+=v.getCapacity();
|
||||
}
|
||||
}
|
||||
|
|
@ -91,7 +98,7 @@ public class GoldenReaderTest {
|
|||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
int nuOfType1Vehicles = 0;
|
||||
for(Vehicle v : vrp.getVehicles()){
|
||||
if(v.getType().getTypeId().equals("type_3")){
|
||||
if(v.getType().getTypeId().equals("type_3") && !(v.getType() instanceof PenaltyVehicleType) ){
|
||||
nuOfType1Vehicles++;
|
||||
}
|
||||
}
|
||||
|
|
@ -106,7 +113,7 @@ public class GoldenReaderTest {
|
|||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
int sumOfType1Cap = 0;
|
||||
for(Vehicle v : vrp.getVehicles()){
|
||||
if(v.getType().getTypeId().equals("type_3")){
|
||||
if(v.getType().getTypeId().equals("type_3") && !(v.getType() instanceof PenaltyVehicleType) ){
|
||||
sumOfType1Cap+=v.getCapacity();
|
||||
}
|
||||
}
|
||||
|
|
@ -121,7 +128,7 @@ public class GoldenReaderTest {
|
|||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
int nuOfType1Vehicles = 0;
|
||||
for(Vehicle v : vrp.getVehicles()){
|
||||
if(v.getType().getTypeId().equals("type_4")){
|
||||
if(v.getType().getTypeId().equals("type_4") && !(v.getType() instanceof PenaltyVehicleType) ){
|
||||
nuOfType1Vehicles++;
|
||||
}
|
||||
}
|
||||
|
|
@ -136,7 +143,7 @@ public class GoldenReaderTest {
|
|||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
int sumOfType1Cap = 0;
|
||||
for(Vehicle v : vrp.getVehicles()){
|
||||
if(v.getType().getTypeId().equals("type_4")){
|
||||
if(v.getType().getTypeId().equals("type_4") && !(v.getType() instanceof PenaltyVehicleType) ){
|
||||
sumOfType1Cap+=v.getCapacity();
|
||||
}
|
||||
}
|
||||
|
|
@ -151,7 +158,7 @@ public class GoldenReaderTest {
|
|||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
int nuOfType1Vehicles = 0;
|
||||
for(Vehicle v : vrp.getVehicles()){
|
||||
if(v.getType().getTypeId().equals("type_5")){
|
||||
if(v.getType().getTypeId().equals("type_5") && !(v.getType() instanceof PenaltyVehicleType) ){
|
||||
nuOfType1Vehicles++;
|
||||
}
|
||||
}
|
||||
|
|
@ -166,7 +173,7 @@ public class GoldenReaderTest {
|
|||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
int sumOfType1Cap = 0;
|
||||
for(Vehicle v : vrp.getVehicles()){
|
||||
if(v.getType().getTypeId().equals("type_5")){
|
||||
if(v.getType().getTypeId().equals("type_5") && !(v.getType() instanceof PenaltyVehicleType) ){
|
||||
sumOfType1Cap+=v.getCapacity();
|
||||
}
|
||||
}
|
||||
|
|
@ -181,7 +188,7 @@ public class GoldenReaderTest {
|
|||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
int nuOfType1Vehicles = 0;
|
||||
for(Vehicle v : vrp.getVehicles()){
|
||||
if(v.getType().getTypeId().equals("type_6")){
|
||||
if(v.getType().getTypeId().equals("type_6") && !(v.getType() instanceof PenaltyVehicleType) ){
|
||||
nuOfType1Vehicles++;
|
||||
}
|
||||
}
|
||||
|
|
@ -196,7 +203,7 @@ public class GoldenReaderTest {
|
|||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
int sumOfType1Cap = 0;
|
||||
for(Vehicle v : vrp.getVehicles()){
|
||||
if(v.getType().getTypeId().equals("type_6")){
|
||||
if(v.getType().getTypeId().equals("type_6") && !(v.getType() instanceof PenaltyVehicleType) ){
|
||||
sumOfType1Cap+=v.getCapacity();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue