use of il.ac.technion.cs.yp.btw.classes.BTWWeight in project BTW by TechnionYearlyProject.
the class TestRoadsDataBase method testGetHeuristicDist.
/*
* @author Sharon Hadar
* @Date 21/01/2018*/
@Test
public void testGetHeuristicDist() {
String mapName = "test";
MainDataBase.openConnection();
Road aaRoad = RoadsDataBase.getRoad("aa", mapName);
Road bbRoad = RoadsDataBase.getRoad("bb", mapName);
BTWWeight dist = aaRoad.getHeuristicDist(bbRoad);
assert (dist.seconds() == 123123);
MainDataBase.closeConnection();
}
use of il.ac.technion.cs.yp.btw.classes.BTWWeight in project BTW by TechnionYearlyProject.
the class VehicleImpl method driveOnRoad.
/**
* @author Guy Rephaeli
*
* Commit a drive on Road rd, on the part
* described by the given ratios
*
* @param rd - The Road to drive on
* @param ratioStart - the ratio from the beginning
* of the Road, We begin our drive at
* @param ratioEnd - the ratio from the the beginning
*/
@Override
public Vehicle driveOnRoad(Road rd, double ratioStart, double ratioEnd) {
CityRoad realRoad = this.simulator.getRealRoad(rd);
BTWWeight weight = realRoad.getCurrentWeight();
this.remainingTimeOnRoad = Double.valueOf((ratioEnd - ratioStart) * weight.seconds()).longValue();
realRoad.addVehicle(this);
return this;
}