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

added multiple caps

This commit is contained in:
oblonski 2014-02-14 15:40:46 +01:00
parent cec4e4235e
commit 8da2d1e1c5
13 changed files with 147 additions and 40 deletions

View file

@ -174,7 +174,10 @@ public class VrpXMLWriter {
xmlConfig.setProperty(shipmentPathString + "("+counter+").coord[@x]", service.getCoord().getX()); xmlConfig.setProperty(shipmentPathString + "("+counter+").coord[@x]", service.getCoord().getX());
xmlConfig.setProperty(shipmentPathString + "("+counter+").coord[@y]", service.getCoord().getY()); xmlConfig.setProperty(shipmentPathString + "("+counter+").coord[@y]", service.getCoord().getY());
} }
xmlConfig.setProperty(shipmentPathString + "("+counter+").capacity-demand", service.getCapacityDemand()); for(int i=0;i<service.getCapacity().getNuOfDimensions();i++){
xmlConfig.setProperty(shipmentPathString + "("+counter+").capacity-dimensions.dimension("+i+")[@index]", i);
xmlConfig.setProperty(shipmentPathString + "("+counter+").capacity-dimensions.dimension("+i+")", service.getCapacity().get(i));
}
xmlConfig.setProperty(shipmentPathString + "("+counter+").duration", service.getServiceDuration()); xmlConfig.setProperty(shipmentPathString + "("+counter+").duration", service.getServiceDuration());
xmlConfig.setProperty(shipmentPathString + "("+counter+").timeWindows.timeWindow(0).start", service.getTimeWindow().getStart()); xmlConfig.setProperty(shipmentPathString + "("+counter+").timeWindows.timeWindow(0).start", service.getTimeWindow().getStart());
xmlConfig.setProperty(shipmentPathString + "("+counter+").timeWindows.timeWindow(0).end", service.getTimeWindow().getEnd()); xmlConfig.setProperty(shipmentPathString + "("+counter+").timeWindows.timeWindow(0).end", service.getTimeWindow().getEnd());
@ -212,8 +215,10 @@ public class VrpXMLWriter {
xmlConfig.setProperty(shipmentPathString + "("+counter+").delivery.timeWindows.timeWindow(0).start", shipment.getDeliveryTimeWindow().getStart()); xmlConfig.setProperty(shipmentPathString + "("+counter+").delivery.timeWindows.timeWindow(0).start", shipment.getDeliveryTimeWindow().getStart());
xmlConfig.setProperty(shipmentPathString + "("+counter+").delivery.timeWindows.timeWindow(0).end", shipment.getDeliveryTimeWindow().getEnd()); xmlConfig.setProperty(shipmentPathString + "("+counter+").delivery.timeWindows.timeWindow(0).end", shipment.getDeliveryTimeWindow().getEnd());
for(int i=0;i<shipment.getCapacity().getNuOfDimensions();i++){
xmlConfig.setProperty(shipmentPathString + "("+counter+").capacity-demand", shipment.getCapacityDemand()); xmlConfig.setProperty(shipmentPathString + "("+counter+").capacity-dimensions.dimension("+i+")[@index]", i);
xmlConfig.setProperty(shipmentPathString + "("+counter+").capacity-dimensions.dimension("+i+")", shipment.getCapacity().get(i));
}
counter++; counter++;
} }
} }
@ -262,7 +267,12 @@ public class VrpXMLWriter {
xmlConfig.setProperty(typePathString + "("+typeCounter+")[@penaltyFactor]", ((PenaltyVehicleType)type).getPenaltyFactor()); xmlConfig.setProperty(typePathString + "("+typeCounter+")[@penaltyFactor]", ((PenaltyVehicleType)type).getPenaltyFactor());
} }
xmlConfig.setProperty(typePathString + "("+typeCounter+").id", type.getTypeId()); xmlConfig.setProperty(typePathString + "("+typeCounter+").id", type.getTypeId());
xmlConfig.setProperty(typePathString + "("+typeCounter+").capacity", type.getCapacity());
for(int i=0;i<type.getCapacityDimensions().getNuOfDimensions();i++){
xmlConfig.setProperty(typePathString + "("+typeCounter+").capacity-dimensions.dimension("+i+")[@index]", i);
xmlConfig.setProperty(typePathString + "("+typeCounter+").capacity-dimensions.dimension("+i+")", type.getCapacityDimensions().get(i));
}
xmlConfig.setProperty(typePathString + "("+typeCounter+").costs.fixed", type.getVehicleCostParams().fix); xmlConfig.setProperty(typePathString + "("+typeCounter+").costs.fixed", type.getVehicleCostParams().fix);
xmlConfig.setProperty(typePathString + "("+typeCounter+").costs.distance", type.getVehicleCostParams().perDistanceUnit); xmlConfig.setProperty(typePathString + "("+typeCounter+").costs.distance", type.getVehicleCostParams().perDistanceUnit);
xmlConfig.setProperty(typePathString + "("+typeCounter+").costs.time", type.getVehicleCostParams().perTimeUnit); xmlConfig.setProperty(typePathString + "("+typeCounter+").costs.time", type.getVehicleCostParams().perTimeUnit);

View file

@ -39,7 +39,7 @@ public interface Job {
* *
* <p>It determines how much capacity this job consumes of vehicle/transport unit. * <p>It determines how much capacity this job consumes of vehicle/transport unit.
* *
* @deprecated use getCapacity() instead * @deprecated use <code>.getCapacity()</code> instead
* @return * @return
*/ */
@Deprecated @Deprecated

View file

@ -44,11 +44,16 @@ public class Service implements Job {
/** /**
* Returns a new instance of service-builder. * Returns a new instance of service-builder.
* *
* <p>Note that if you use this builder, size is assigned to capacity-dimension with index=0.
*
* @param id of service * @param id of service
* @param size of capacity-demand * @param size of capacity-demand
* @return builder * @return builder
* @throws IllegalArgumentException if size < 0 or id is null * @throws IllegalArgumentException if size < 0 or id is null
* @deprecated use <code>.newInstance(String id)</code> instead, and add a capacity dimension
* with dimensionIndex='your index' and and dimsionValue=size to the returned builder
*/ */
@Deprecated
public static Builder newInstance(String id, int size){ public static Builder newInstance(String id, int size){
Builder builder = new Builder(id,size); Builder builder = new Builder(id,size);
builder.addCapacityDimension(0, size); builder.addCapacityDimension(0, size);
@ -71,7 +76,6 @@ public class Service implements Job {
protected TimeWindow timeWindow = TimeWindow.newInstance(0.0, Double.MAX_VALUE); protected TimeWindow timeWindow = TimeWindow.newInstance(0.0, Double.MAX_VALUE);
protected int demand;
protected Capacity.Builder capacityBuilder = Capacity.Builder.newInstance(); protected Capacity.Builder capacityBuilder = Capacity.Builder.newInstance();
protected Capacity capacity; protected Capacity capacity;
@ -86,7 +90,6 @@ public class Service implements Job {
if(size < 0) throw new IllegalArgumentException("size must be greater than or equal to zero"); if(size < 0) throw new IllegalArgumentException("size must be greater than or equal to zero");
if(id == null) throw new IllegalArgumentException("id must not be null"); if(id == null) throw new IllegalArgumentException("id must not be null");
this.id = id; this.id = id;
this.demand = size;
} }
Builder(String id){ Builder(String id){
@ -144,7 +147,13 @@ public class Service implements Job {
return this; return this;
} }
/**
* Adds capacity dimension.
*
* @param dimensionIndex
* @param dimensionValue
* @return the builder
*/
public Builder addCapacityDimension(int dimensionIndex, int dimensionValue){ public Builder addCapacityDimension(int dimensionIndex, int dimensionValue){
capacityBuilder.addDimension(dimensionIndex, dimensionValue); capacityBuilder.addDimension(dimensionIndex, dimensionValue);
return this; return this;
@ -196,7 +205,7 @@ public class Service implements Job {
private final TimeWindow timeWindow; private final TimeWindow timeWindow;
private final int demand; // private final int demand;
private final Capacity capacity; private final Capacity capacity;
@ -206,7 +215,6 @@ public class Service implements Job {
coord = builder.coord; coord = builder.coord;
serviceTime = builder.serviceTime; serviceTime = builder.serviceTime;
timeWindow = builder.timeWindow; timeWindow = builder.timeWindow;
demand = builder.demand;
type = builder.type; type = builder.type;
capacity = builder.capacity; capacity = builder.capacity;
} }
@ -252,9 +260,15 @@ public class Service implements Job {
return timeWindow; return timeWindow;
} }
/**
* @Deprecated use <code>.getCapacity()</code> instead. if you still use this method, it returns the
* capacity dimension with index=0.
*
*/
@Override @Override
@Deprecated
public int getCapacityDemand() { public int getCapacityDemand() {
return demand; return capacity.get(0);
} }
/** /**
@ -271,7 +285,7 @@ public class Service implements Job {
*/ */
@Override @Override
public String toString() { public String toString() {
return "[id=" + id + "][type="+type+"][locationId=" + locationId + "][coord="+coord+"][size=" + demand + "][serviceTime=" + serviceTime + "][timeWindow=" + timeWindow + "]"; return "[id=" + id + "][type="+type+"][locationId=" + locationId + "][coord="+coord+"][capacity=" + capacity + "][serviceTime=" + serviceTime + "][timeWindow=" + timeWindow + "]";
} }

View file

@ -31,8 +31,6 @@ public class Shipment implements Job{
*/ */
public static class Builder { public static class Builder {
private int demand;
private String id; private String id;
private String pickupLocation; private String pickupLocation;
@ -58,11 +56,16 @@ public class Shipment implements Job{
/** /**
* Returns a new instance of this builder. * Returns a new instance of this builder.
* *
* <p>Note that if you use this builder, size is assigned to capacity-dimension with index=0.
*
* @param id * @param id
* @param size * @param size
* @return builder * @return builder
* @throws IllegalArgumentException if size < 0 or id is null * @throws IllegalArgumentException if size < 0 or id is null
* @deprecated use <code>.newInstance(String id)</code> instead, and add a capacity dimension
* with dimensionIndex='your index' and and dimsionValue=size to the returned builder
*/ */
@Deprecated
public static Builder newInstance(String id, int size){ public static Builder newInstance(String id, int size){
Builder builder = new Builder(id,size); Builder builder = new Builder(id,size);
builder.addCapacityDimension(0, size); builder.addCapacityDimension(0, size);
@ -84,7 +87,6 @@ public class Shipment implements Job{
if(size < 0) throw new IllegalArgumentException("size must be greater than or equal to zero"); if(size < 0) throw new IllegalArgumentException("size must be greater than or equal to zero");
if(id == null) throw new IllegalArgumentException("id must not be null"); if(id == null) throw new IllegalArgumentException("id must not be null");
this.id = id; this.id = id;
this.demand = size;
} }
Builder(String id){ Builder(String id){
@ -241,8 +243,6 @@ public class Shipment implements Job{
} }
private final int demand;
private final String id; private final String id;
private final String pickupLocation; private final String pickupLocation;
@ -271,7 +271,6 @@ public class Shipment implements Job{
*/ */
Shipment(Builder builder){ Shipment(Builder builder){
this.id = builder.id; this.id = builder.id;
this.demand = builder.demand;
this.pickupLocation = builder.pickupLocation; this.pickupLocation = builder.pickupLocation;
this.pickupCoord = builder.pickupCoord; this.pickupCoord = builder.pickupCoord;
this.pickupServiceTime = builder.pickupServiceTime; this.pickupServiceTime = builder.pickupServiceTime;
@ -288,9 +287,14 @@ public class Shipment implements Job{
return id; return id;
} }
/**
* @Deprecated use <code>.getCapacity()</code> instead. if you still use this method, it returns the
* capacity dimension with index=0.
*/
@Deprecated
@Override @Override
public int getCapacityDemand() { public int getCapacityDemand() {
return demand; return capacity.get(0);
} }
/** /**

View file

@ -81,7 +81,11 @@ public interface Vehicle {
* Returns the capacity of this vehicle. * Returns the capacity of this vehicle.
* *
* @return capacity * @return capacity
* @deprecated use .getType().getCapacityDimensions() - if you still use this method,
* but set capacity-dimensions via <code>VehicleTypeImpl.Builder.newInstance(...).addCapacityDimension(...)</code> then this method returns the
* dimension with index=0.
*/ */
@Deprecated
public abstract int getCapacity(); public abstract int getCapacity();
/** /**

View file

@ -372,6 +372,7 @@ public class VehicleImpl implements Vehicle {
} }
@Override @Override
@Deprecated
public int getCapacity() { public int getCapacity() {
return type.getCapacity(); return type.getCapacity();
} }

View file

@ -39,8 +39,12 @@ public interface VehicleType {
* *
* <p>In future versions there will be a capacity-object with an arbitrary number of capacity dimensions. (stefan,11.01.14) * <p>In future versions there will be a capacity-object with an arbitrary number of capacity dimensions. (stefan,11.01.14)
* *
*
* @deprecated use <code>.getCapacityDimensions()</code> - if you still use it, but set CapacityDimensions rather
* than setCapacity(...) it will return the capacity.dimension with index=0
* @return cap * @return cap
*/ */
@Deprecated
public int getCapacity(); public int getCapacity();
/** /**

View file

@ -187,6 +187,13 @@ public class VehicleTypeImpl implements VehicleType {
return new VehicleTypeImpl(this); return new VehicleTypeImpl(this);
} }
/**
* Adds a capacity dimension.
*
* @param dimIndex
* @param dimVal
* @return the builder
*/
public Builder addCapacityDimension(int dimIndex, int dimVal) { public Builder addCapacityDimension(int dimIndex, int dimVal) {
capacityBuilder.addDimension(dimIndex,dimVal); capacityBuilder.addDimension(dimIndex,dimVal);
return this; return this;
@ -285,8 +292,9 @@ public class VehicleTypeImpl implements VehicleType {
* @see basics.route.VehicleType#getCapacity() * @see basics.route.VehicleType#getCapacity()
*/ */
@Override @Override
@Deprecated
public int getCapacity() { public int getCapacity() {
return capacity; return capacityDimensions.get(0);
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -84,8 +84,8 @@
<xs:element name="capacity" type="xs:integer" minOccurs="0" maxOccurs="1" default="0"/> <xs:element name="capacity" type="xs:integer" minOccurs="0" maxOccurs="1" default="0"/>
<xs:element name="capacity-dimensions" minOccurs="0" maxOccurs="1"> <xs:element name="capacity-dimensions" minOccurs="0" maxOccurs="1">
<xs:complexType> <xs:complexType>
<xs:all> <xs:sequence>
<xs:element name="dimension" minOccurs="1"> <xs:element name="dimension" minOccurs="1" maxOccurs="unbounded">
<xs:complexType> <xs:complexType>
<xs:simpleContent> <xs:simpleContent>
<xs:extension base="xs:integer"> <xs:extension base="xs:integer">
@ -94,7 +94,7 @@
</xs:simpleContent> </xs:simpleContent>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
</xs:all> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="costs"> <xs:element name="costs">
@ -126,8 +126,8 @@
<xs:element name="capacity-demand" type="xs:integer" minOccurs="0" maxOccurs="1" default="0"/> <xs:element name="capacity-demand" type="xs:integer" minOccurs="0" maxOccurs="1" default="0"/>
<xs:element name="capacity-dimensions" minOccurs="0" maxOccurs="1"> <xs:element name="capacity-dimensions" minOccurs="0" maxOccurs="1">
<xs:complexType> <xs:complexType>
<xs:all> <xs:sequence>
<xs:element name="dimension" minOccurs="1"> <xs:element name="dimension" minOccurs="1" maxOccurs="unbounded">
<xs:complexType> <xs:complexType>
<xs:simpleContent> <xs:simpleContent>
<xs:extension base="xs:integer"> <xs:extension base="xs:integer">
@ -136,7 +136,7 @@
</xs:simpleContent> </xs:simpleContent>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
</xs:all> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="duration" type="xs:decimal" minOccurs="0" maxOccurs="1" default="0.0"/> <xs:element name="duration" type="xs:decimal" minOccurs="0" maxOccurs="1" default="0.0"/>
@ -195,11 +195,11 @@
</xs:all> </xs:all>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="capacity-demand" type="xs:integer" minOccurs="1" maxOccurs="1"/> <xs:element name="capacity-demand" type="xs:integer" minOccurs="0" maxOccurs="1"/>
<xs:element name="capacity-dimensions" minOccurs="0" maxOccurs="1"> <xs:element name="capacity-dimensions" minOccurs="0" maxOccurs="1">
<xs:complexType> <xs:complexType>
<xs:all> <xs:sequence>
<xs:element name="dimension" minOccurs="1"> <xs:element name="dimension" minOccurs="1" maxOccurs="unbounded">
<xs:complexType> <xs:complexType>
<xs:simpleContent> <xs:simpleContent>
<xs:extension base="xs:integer"> <xs:extension base="xs:integer">
@ -208,7 +208,7 @@
</xs:simpleContent> </xs:simpleContent>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
</xs:all> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
</xs:sequence> </xs:sequence>

View file

@ -59,10 +59,11 @@ public class VrpReaderV2Test {
VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
new VrpXMLReader(builder, null).read(inFileName); new VrpXMLReader(builder, null).read(inFileName);
VehicleRoutingProblem vrp = builder.build(); VehicleRoutingProblem vrp = builder.build();
assertEquals(4,vrp.getVehicles().size()); assertEquals(5,vrp.getVehicles().size());
assertTrue(idsInCollection(Arrays.asList("v1","v2"),vrp.getVehicles())); assertTrue(idsInCollection(Arrays.asList("v1","v2"),vrp.getVehicles()));
} }
@SuppressWarnings("deprecation")
@Test @Test
public void whenReadingVrp_vehiclesAreReadCorrectly2(){ public void whenReadingVrp_vehiclesAreReadCorrectly2(){
VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
@ -70,6 +71,7 @@ public class VrpReaderV2Test {
VehicleRoutingProblem vrp = builder.build(); VehicleRoutingProblem vrp = builder.build();
Vehicle v1 = getVehicle("v1",vrp.getVehicles()); Vehicle v1 = getVehicle("v1",vrp.getVehicles());
assertEquals(20,v1.getCapacity()); assertEquals(20,v1.getCapacity());
assertEquals(20,v1.getType().getCapacityDimensions().get(0));
assertEquals(100.0,v1.getStartLocationCoordinate().getX(),0.01); assertEquals(100.0,v1.getStartLocationCoordinate().getX(),0.01);
assertEquals(0.0,v1.getEarliestDeparture(),0.01); assertEquals(0.0,v1.getEarliestDeparture(),0.01);
assertEquals("depotLoc2",v1.getStartLocationId()); assertEquals("depotLoc2",v1.getStartLocationId());
@ -96,7 +98,7 @@ public class VrpReaderV2Test {
VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
new VrpXMLReader(builder, null).read(inFileName); new VrpXMLReader(builder, null).read(inFileName);
VehicleRoutingProblem vrp = builder.build(); VehicleRoutingProblem vrp = builder.build();
assertEquals(2,vrp.getTypes().size()); assertEquals(3,vrp.getTypes().size());
} }
@Test @Test
@ -139,6 +141,7 @@ public class VrpReaderV2Test {
assertEquals(2,shipCounter); assertEquals(2,shipCounter);
} }
@SuppressWarnings("deprecation")
@Test @Test
public void whenReadingServices_capOfService1IsReadCorrectly(){ public void whenReadingServices_capOfService1IsReadCorrectly(){
VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
@ -146,6 +149,7 @@ public class VrpReaderV2Test {
VehicleRoutingProblem vrp = builder.build(); VehicleRoutingProblem vrp = builder.build();
Service s1 = (Service) vrp.getJobs().get("1"); Service s1 = (Service) vrp.getJobs().get("1");
assertEquals(1,s1.getCapacityDemand()); assertEquals(1,s1.getCapacityDemand());
assertEquals(1,s1.getCapacity().get(0));
} }
@Test @Test
@ -299,6 +303,7 @@ public class VrpReaderV2Test {
assertEquals("startLoc",v.getStartLocationId()); assertEquals("startLoc",v.getStartLocationId());
} }
@SuppressWarnings("deprecation")
@Test @Test
public void whenReadingJobs_capOfShipment3IsReadCorrectly(){ public void whenReadingJobs_capOfShipment3IsReadCorrectly(){
VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
@ -306,6 +311,7 @@ public class VrpReaderV2Test {
VehicleRoutingProblem vrp = builder.build(); VehicleRoutingProblem vrp = builder.build();
Shipment s = (Shipment) vrp.getJobs().get("3"); Shipment s = (Shipment) vrp.getJobs().get("3");
assertEquals(10,s.getCapacityDemand()); assertEquals(10,s.getCapacityDemand());
assertEquals(10,s.getCapacity().get(0));
} }
@Test @Test
@ -419,5 +425,20 @@ public class VrpReaderV2Test {
Shipment s = (Shipment) vrp.getJobs().get("4"); Shipment s = (Shipment) vrp.getJobs().get("4");
assertEquals(100.0,s.getDeliveryServiceTime(),0.01); assertEquals(100.0,s.getDeliveryServiceTime(),0.01);
} }
@Test
public void whenReadingFile_v5AndItsTypeHasTheCorrectCapacityDimensionValues(){
VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
new VrpXMLReader(builder, null).read(inFileName);
VehicleRoutingProblem vrp = builder.build();
Vehicle v = getVehicle("v5",vrp.getVehicles());
// assertEquals(100, v.getType().getCapacityDimensions().get(0));
assertEquals(1000, v.getType().getCapacityDimensions().get(1));
// assertEquals(10000, v.getType().getCapacityDimensions().get(2));
// assertEquals(0, v.getType().getCapacityDimensions().get(3));
// assertEquals(0, v.getType().getCapacityDimensions().get(5));
// assertEquals(100000, v.getType().getCapacityDimensions().get(10));
}
} }

View file

@ -35,7 +35,7 @@ import jsprit.core.util.Coordinate;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
@SuppressWarnings("deprecation")
public class VrpWriterV2Test { public class VrpWriterV2Test {
private String infileName; private String infileName;
@ -100,6 +100,7 @@ public class VrpWriterV2Test {
builder.addVehicle(v1); builder.addVehicle(v1);
builder.addVehicle(v2); builder.addVehicle(v2);
Service s1 = Service.Builder.newInstance("1", 1).setLocationId("loc").setServiceTime(2.0).build(); Service s1 = Service.Builder.newInstance("1", 1).setLocationId("loc").setServiceTime(2.0).build();
Service s2 = Service.Builder.newInstance("2", 1).setLocationId("loc2").setServiceTime(4.0).build(); Service s2 = Service.Builder.newInstance("2", 1).setLocationId("loc2").setServiceTime(4.0).build();

View file

@ -85,12 +85,28 @@
<end>1000.0</end> <end>1000.0</end>
</timeSchedule> </timeSchedule>
</vehicle> </vehicle>
<vehicle>
<id>v5</id>
<location>
<id>startLoc</id>
<coord x="10.0" y="100.0"/>
</location>
<endLocation>
<id>endLoc</id>
<coord x="1000.0" y="2000.0"/>
</endLocation>
<typeId>vehType3</typeId>
<timeSchedule>
<start>0.0</start>
<end>1000.0</end>
</timeSchedule>
</vehicle>
</vehicles> </vehicles>
<vehicleTypes> <vehicleTypes>
<type> <type>
<id>vehType</id> <id>vehType</id>
<capacity-dimensions> <capacity-dimensions>
<dimension index="1">20</dimension> <dimension index="0">20</dimension>
</capacity-dimensions> </capacity-dimensions>
<costs> <costs>
<fixed>0.0</fixed> <fixed>0.0</fixed>
@ -107,6 +123,20 @@
<time>0.0</time> <time>0.0</time>
</costs> </costs>
</type> </type>
<type>
<id>vehType3</id>
<capacity-dimensions>
<dimension index="0">100</dimension>
<dimension index="1">1000</dimension>
<dimension index="2">10000</dimension>
<dimension index="10">100000</dimension>
</capacity-dimensions>
<costs>
<fixed>0.0</fixed>
<distance>0.0</distance>
<time>0.0</time>
</costs>
</type>
</vehicleTypes> </vehicleTypes>
<services> <services>
@ -114,7 +144,7 @@
<locationId>j(1,5)</locationId> <locationId>j(1,5)</locationId>
<coord x="10.0" y="10.0"/> <coord x="10.0" y="10.0"/>
<capacity-dimensions> <capacity-dimensions>
<dimension index="1">1</dimension> <dimension index="0">1</dimension>
</capacity-dimensions> </capacity-dimensions>
<duration>10.0</duration> <duration>10.0</duration>
<timeWindows> <timeWindows>
@ -187,7 +217,9 @@
</timeWindow> </timeWindow>
</timeWindows> </timeWindows>
</delivery> </delivery>
<capacity-demand>10</capacity-demand> <capacity-dimensions>
<dimension index="0">10</dimension>
</capacity-dimensions>
</shipment> </shipment>
</shipments> </shipments>

View file

@ -42,7 +42,9 @@
<vehicleTypes> <vehicleTypes>
<type> <type>
<id>vehType</id> <id>vehType</id>
<capacity>20</capacity> <capacity-dimensions>
<dimension index="0">20</dimension>
</capacity-dimensions>
<costs> <costs>
<fixed>0.0</fixed> <fixed>0.0</fixed>
<distance>1.0</distance> <distance>1.0</distance>
@ -51,7 +53,9 @@
</type> </type>
<type> <type>
<id>vehType2</id> <id>vehType2</id>
<capacity>200</capacity> <capacity-dimensions>
<dimension index="0">200</dimension>
</capacity-dimensions>
<costs> <costs>
<fixed>0.0</fixed> <fixed>0.0</fixed>
<distance>1.0</distance> <distance>1.0</distance>
@ -62,7 +66,9 @@
<services> <services>
<service id="2" type="service"> <service id="2" type="service">
<locationId>loc2</locationId> <locationId>loc2</locationId>
<capacity-demand>1</capacity-demand> <capacity-dimensions>
<dimension index="0">1</dimension>
</capacity-dimensions>
<duration>4.0</duration> <duration>4.0</duration>
<timeWindows> <timeWindows>
<timeWindow> <timeWindow>
@ -73,7 +79,9 @@
</service> </service>
<service id="1" type="service"> <service id="1" type="service">
<locationId>loc</locationId> <locationId>loc</locationId>
<capacity-demand>1</capacity-demand> <capacity-dimensions>
<dimension index="0">1</dimension>
</capacity-dimensions>
<duration>2.0</duration> <duration>2.0</duration>
<timeWindows> <timeWindows>
<timeWindow> <timeWindow>