mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
issue #144 - replace deprecated methods
This commit is contained in:
parent
c083b74ea7
commit
600087fd33
48 changed files with 398 additions and 379 deletions
|
|
@ -1,31 +1,30 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (C) 2013 Stefan Schroeder
|
||||
*
|
||||
* Copyright (C) 2014 Stefan Schroeder
|
||||
*
|
||||
* 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
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 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/>.
|
||||
******************************************************************************/
|
||||
package jsprit.instance.reader;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import jsprit.core.problem.VehicleRoutingProblem;
|
||||
import jsprit.core.problem.VehicleRoutingProblem.FleetSize;
|
||||
import jsprit.core.problem.job.Service;
|
||||
import jsprit.core.problem.vehicle.Vehicle;
|
||||
import jsprit.instance.reader.CordeauReader;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
|
||||
public class CordeauReaderTest {
|
||||
|
||||
|
|
@ -81,8 +80,8 @@ public class CordeauReaderTest {
|
|||
new CordeauReader(vrpBuilder).read(this.getClass().getClassLoader().getResource("p01").getPath());
|
||||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
Service service = (Service) vrp.getJobs().get("1");
|
||||
assertEquals(37.0, service.getCoord().getX(), 0.1);
|
||||
assertEquals(52.0, service.getCoord().getY(), 0.1);
|
||||
assertEquals(37.0, service.getLocation().getCoordinate().getX(), 0.1);
|
||||
assertEquals(52.0, service.getLocation().getCoordinate().getY(), 0.1);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -1,8 +1,22 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (C) 2014 Stefan Schroeder
|
||||
*
|
||||
* 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.0 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/>.
|
||||
******************************************************************************/
|
||||
|
||||
package jsprit.instance.reader;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import jsprit.core.problem.VehicleRoutingProblem;
|
||||
import jsprit.core.problem.job.Job;
|
||||
import jsprit.core.problem.job.Service;
|
||||
|
|
@ -10,9 +24,10 @@ import jsprit.core.problem.vehicle.PenaltyVehicleType;
|
|||
import jsprit.core.problem.vehicle.Vehicle;
|
||||
import jsprit.core.util.Coordinate;
|
||||
import jsprit.instance.reader.VrphGoldenReader.VrphType;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class GoldenReaderTest {
|
||||
|
||||
@Test
|
||||
|
|
@ -274,7 +289,7 @@ public class GoldenReaderTest {
|
|||
|
||||
private Coordinate getCoord(String string, VehicleRoutingProblem vrp) {
|
||||
Job j = getJob(string,vrp);
|
||||
return ((Service)j).getCoord();
|
||||
return ((Service)j).getLocation().getCoordinate();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue