org.gscg.singleuser.production
Class GameDelayProductionService

java.lang.Object
  extended bynl.tudelft.simulation.supplychain.production.ProductionService
      extended byorg.gscg.singleuser.production.GameDelayProductionService
All Implemented Interfaces:
nl.tudelft.simulation.supplychain.production.ProductionServiceInterface, java.io.Serializable

public class GameDelayProductionService
extends nl.tudelft.simulation.supplychain.production.ProductionService

The GameDelayProductionService starts production at the latest possible moment to meet the delivery date of the production order. Two versions are available: one that waits till all the raw materials are available. If not, production is delayed until all materials of the BoM are available in the right quantities. The other version is a greedy one, it takes all the materials it needs from the moment production should start, and delays if necessary to get the missing materials.

Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl . The source code and binary code of this software is proprietary information of Delft University of Technology.

Version:
$$Revision: 1.3 $$ $$Date: 2005/08/10 11:23:30 $$
Author:
Alexander Verbraeck
See Also:
Serialized Form

Field Summary
static nl.tudelft.simulation.event.EventType EVENT_PRODUCTION_STARTED
          the EVENT_PRODUCTION_STARTED event
protected  boolean fixedTime
          fixed time, independent of order size; otherwise time is per unit
protected  boolean greedy
          if true, immediately start picking raw materials
protected  nl.tudelft.simulation.jstats.distributions.DistContinuous productionTime
          the time distribution to produce products
protected  double profitMargin
          the fraction that is added to the cost of the materials
 
Fields inherited from class nl.tudelft.simulation.supplychain.production.ProductionService
owner, product, stock
 
Constructor Summary
GameDelayProductionService(nl.tudelft.simulation.supplychain.actor.Trader owner, nl.tudelft.simulation.supplychain.stock.StockInterface stock, nl.tudelft.simulation.supplychain.product.Product product, nl.tudelft.simulation.jstats.distributions.DistContinuous productionTime, boolean fixedTime, boolean greedy, double profitMargin)
          Constructs a new production service for one product.
 
Method Summary
 void acceptProductionOrder(nl.tudelft.simulation.supplychain.content.ProductionOrder productionOrder)
          Accept the production order, and delay till the start of production (equals delivery time minus production time minus transportation time) to get the raw materials to produce.
protected  void endProduction(nl.tudelft.simulation.supplychain.content.ProductionOrder productionOrder)
          endProduction is scheduled after the production time, which starts when all raw materials are available.
 nl.tudelft.simulation.event.EventProducer getEventProducer()
          Method getEventProducer
protected  boolean pickRawMaterials(nl.tudelft.simulation.supplychain.content.ProductionOrder productionOrder, java.util.HashMap availableMaterials, boolean pick)
           
protected  void startProduction(nl.tudelft.simulation.supplychain.content.ProductionOrder productionOrder, double ptime, java.util.HashMap availableMaterials)
          Start the production at the latest possible time.
 
Methods inherited from class nl.tudelft.simulation.supplychain.production.ProductionService
getProduct
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT_PRODUCTION_STARTED

public static final nl.tudelft.simulation.event.EventType EVENT_PRODUCTION_STARTED
the EVENT_PRODUCTION_STARTED event


productionTime

protected nl.tudelft.simulation.jstats.distributions.DistContinuous productionTime
the time distribution to produce products


fixedTime

protected boolean fixedTime
fixed time, independent of order size; otherwise time is per unit


greedy

protected boolean greedy
if true, immediately start picking raw materials


profitMargin

protected double profitMargin
the fraction that is added to the cost of the materials

Constructor Detail

GameDelayProductionService

public GameDelayProductionService(nl.tudelft.simulation.supplychain.actor.Trader owner,
                                  nl.tudelft.simulation.supplychain.stock.StockInterface stock,
                                  nl.tudelft.simulation.supplychain.product.Product product,
                                  nl.tudelft.simulation.jstats.distributions.DistContinuous productionTime,
                                  boolean fixedTime,
                                  boolean greedy,
                                  double profitMargin)
Constructs a new production service for one product.

Parameters:
owner - the actor that owns the production service.
stock - the stock for getting and storing materials.
product - the product of the production service.
productionTime - the time distribution to produce products.
fixedTime - fixed time, independent of order size; otherwise, the time is per unit.
greedy - if true, immediately start picking raw materials when production has to start.
profitMargin - the fraction that is added to the cost of the materials.
Method Detail

acceptProductionOrder

public void acceptProductionOrder(nl.tudelft.simulation.supplychain.content.ProductionOrder productionOrder)
Accept the production order, and delay till the start of production (equals delivery time minus production time minus transportation time) to get the raw materials to produce. Acquire the materials either greedy or all-at-once.

See Also:
ProductionServiceInterface.acceptProductionOrder(nl.tudelft.simulation.supplychain.content.ProductionOrder)

startProduction

protected void startProduction(nl.tudelft.simulation.supplychain.content.ProductionOrder productionOrder,
                               double ptime,
                               java.util.HashMap availableMaterials)
Start the production at the latest possible time. When raw materials are

Parameters:
productionOrder - the production order.
ptime - the production time.
availableMaterials - the gathered raw materials.

pickRawMaterials

protected boolean pickRawMaterials(nl.tudelft.simulation.supplychain.content.ProductionOrder productionOrder,
                                   java.util.HashMap availableMaterials,
                                   boolean pick)
Parameters:
productionOrder - the order that has to be produced
availableMaterials - the materials we already have picked
pick - pick materials (true) or just check availability (false)
Returns:
success meaning that all materials were available

endProduction

protected void endProduction(nl.tudelft.simulation.supplychain.content.ProductionOrder productionOrder)
endProduction is scheduled after the production time, which starts when all raw materials are available. The task of this scheduled method is to store the finished products in stock.

Parameters:
productionOrder - the original production order

getEventProducer

public nl.tudelft.simulation.event.EventProducer getEventProducer()
Method getEventProducer

Returns:
returns the event producer used to fire events


Copyright © 2002-2005 Delft University of Technology, the Netherlands. All Rights Reserved.