package nl.tudelft.simulation.examples.dsol.dess;
import java.io.Serializable;
import java.rmi.RemoteException;
import nl.tudelft.simulation.dsol.formalisms.dess.DifferentialEquation;
import nl.tudelft.simulation.dsol.simtime.SimTimeDouble;
import nl.tudelft.simulation.dsol.simulators.DESSSimulatorInterface;
/**
*
* Copyright (c) 2002-2021 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved.
*
* See for project information www.simulation.tudelft.nl.
*
* @author Alexander Verbraeck
*/
public class Distance extends DifferentialEquation
{
/** */
private static final long serialVersionUID = 1L;
/** the speed. */
private Speed speed = null;
/**
* constructs a new Distance.
* @param simulator DESSSimulatorInterface.TimeDouble; the simulator
* @throws RemoteException on network error
*/
public Distance(final DESSSimulatorInterface.TimeDouble simulator) throws RemoteException
{
super(simulator, 1);
this.speed = new Speed(simulator);
this.speed.initialize(10, new double[] {0});
this.initialize(10, new double[] {0});
}
/** {@inheritDoc} */
@Override
public double[] dy(final double x, final double[] y)
{
return this.speed.y(x);
}
/** {@inheritDoc} */
@Override
public Serializable getSourceId()
{
return "Distance";
}
}