package org.opentrafficsim.road.gtu.strategical;
import org.djutils.draw.line.PolyLine3d;
import org.djutils.draw.point.Point3d;
import org.junit.Test;
import org.opentrafficsim.base.parameters.Parameters;
import org.opentrafficsim.core.dsol.OTSSimulatorInterface;
import org.opentrafficsim.core.gtu.GtuException;
import org.opentrafficsim.core.network.LinkType;
import org.opentrafficsim.core.network.NetworkException;
import org.opentrafficsim.core.network.OTSLink;
import org.opentrafficsim.core.network.OTSNode;
import org.opentrafficsim.road.DefaultTestParameters;
import org.opentrafficsim.road.gtu.lane.tactical.LaneBasedCFLCTacticalPlanner;
import org.opentrafficsim.road.gtu.lane.tactical.following.CarFollowingModel;
import org.opentrafficsim.road.gtu.lane.tactical.following.IDMPlus;
import org.opentrafficsim.road.mock.MockSimulator;
import org.opentrafficsim.road.network.OTSRoadNetwork;
/**
* Test the LaneBasedStrategicalRoutePlanner class.
*
* Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
* BSD-style license. See OpenTrafficSim License.
*
* @version $Revision$, $LastChangedDate$, by $Author$, initial version Apr 19, 2016
* @author Alexander Verbraeck
* @author Peter Knoppers
*/
public class LaneBasedStrategicalRoutePlannerTest
{
/**
* Test the nextLinkDirection method.
* @throws GtuException if not caught this test has failed
* @throws NetworkException if not caught this test has failed
*/
@Test
public final void nextLinkDirectionTest() throws GtuException, NetworkException
{
OTSSimulatorInterface simulator = MockSimulator.createMock();
OTSRoadNetwork network = new OTSRoadNetwork("next link direction test", true, simulator);
// Build a really simple network
OTSNode fromNode = new OTSNode(network, "from", new Point3d(0, 0, 0));
OTSNode toNode = new OTSNode(network, "to", new Point3d(100, 0, 0));
PolyLine3d designLine = new PolyLine3d(fromNode.getPoint(), toNode.getPoint());
OTSLink link = new OTSLink(network, "link", fromNode, toNode, network.getLinkType(LinkType.DEFAULTS.ROAD), designLine);
CarFollowingModel cfm = new IDMPlus();
LaneBasedCFLCTacticalPlanner tacticalPlanner = new LaneBasedCFLCTacticalPlanner(null, null, null);
Parameters params = DefaultTestParameters.create();
// TODO Gtu cannot be null anymore...
// LaneBasedStrategicalRoutePlanner lbsrp = new LaneBasedStrategicalRoutePlanner(params, tacticalPlanner, null);
}
}