package nl.tudelft.simulation.examples.dsol.mm1queue;
import java.rmi.RemoteException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import nl.tudelft.simulation.dsol.formalisms.Resource;
import nl.tudelft.simulation.dsol.simtime.SimTimeDouble;
import nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface;
/**
* The Seize is an extended Seize block whic sets delay times on arriving customers.
* (c) copyright 2003 Delft University of Technology , the Netherlands.
*
* See for project information www.simulation.tudelft.nl
* License of use: General Public License (GPL) , no warranty
* @version 2.0 21.09.2003
* @author Peter Jacobs
*/
public class Seize extends nl.tudelft.simulation.dsol.formalisms.flow.Seize.TimeDouble
{
/** */
private static final long serialVersionUID = 1L;
/** the logger. */
private static Logger logger = LogManager.getLogger(Seize.class);
/**
* constructs a new Seize.
* @param simulator the devs simulator on which to schedule
* @param resource the resource to claim
*/
public Seize(final DEVSSimulatorInterface.TimeDouble simulator, final Resource resource)
{
super(simulator, resource);
}
/**
* constructs a new Seize.
* @param simulator the devs simulator on which to schedule
* @param resource the resource to claim
* @param requestedCapacity the amount to claim
*/
public Seize(final DEVSSimulatorInterface.TimeDouble simulator, final Resource resource,
final double requestedCapacity)
{
super(simulator, resource, requestedCapacity);
}
/** {@inheritDoc} */
@Override
public final void receiveObject(final Object object) throws RemoteException
{
Customer customer = (Customer) object;
try
{
customer.setEntranceTime(this.simulator.getSimulatorTime().get());
}
catch (RemoteException exception)
{
logger.warn("receiveObject", exception);
}
super.receiveObject(object);
}
}