org.gscg.gameactors
Class GameMarket

java.lang.Object
  extended bynl.tudelft.simulation.actor.Actor
      extended bynl.tudelft.simulation.supplychain.actor.SupplyChainActor
          extended bynl.tudelft.simulation.supplychain.reference.Customer
              extended byorg.gscg.gameactors.GameMarket
All Implemented Interfaces:
nl.tudelft.simulation.actor.ActorInterface, GameActorInterface, nl.tudelft.simulation.content.HandlerInterface, nl.tudelft.simulation.dsol.animation.LocatableInterface, java.io.Serializable

public class GameMarket
extends nl.tudelft.simulation.supplychain.reference.Customer
implements GameActorInterface

The GameMarket extends a Customer from the supplychain project and provides additional game-specific functionalities.
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.

Since:
1.0.0
Version:
$Revision: 1.1 $ $Date: 2005/08/03 08:52:50 $
Author:
Alexander Verbraeck
See Also:
Serialized Form

Field Summary
 
Fields inherited from class nl.tudelft.simulation.supplychain.actor.SupplyChainActor
bankAccount
 
Fields inherited from class nl.tudelft.simulation.actor.Actor
contentHandlers, location, locationDescription, name, receivingDevices, sendingDevices, simulator
 
Constructor Summary
GameMarket(java.lang.String name, nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface simulator, javax.vecmath.Point3d position, nl.tudelft.simulation.supplychain.banking.Bank bank)
          constructs a new GameMarket; used when dragging and dropping an actor
GameMarket(java.lang.String name, nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface simulator, javax.vecmath.Point3d position, nl.tudelft.simulation.supplychain.banking.Bank bank, double initialBankAccount, nl.tudelft.simulation.supplychain.product.Product[] product, nl.tudelft.simulation.supplychain.demand.Demand[] demand, nl.tudelft.simulation.supplychain.reference.Retailer[] retailer)
          constructs a new GameMarket
 
Method Summary
 double calculateDistance(nl.tudelft.simulation.supplychain.actor.SupplyChainActor actor)
           
 void changeDemand(nl.tudelft.simulation.supplychain.product.Product product, boolean up, double percentage)
          Method changeDemand changes the demand of a PCMarket for the specified product.
protected  GisActorAnimation getAnimation()
           
 javax.media.j3d.Bounds getBounds()
           
 java.lang.String getName()
           
 nl.tudelft.simulation.language.d3.DirectedPoint getSmallMapLocation()
           
 void init()
           
 void setSmallMapLocation(nl.tudelft.simulation.language.d3.DirectedPoint smallMapLocation)
           
 
Methods inherited from class nl.tudelft.simulation.supplychain.reference.Customer
getBuyingRole, getDemandGenerationRole, handleContent, setBuyingRole, setDemandGenerationRole
 
Methods inherited from class nl.tudelft.simulation.supplychain.actor.SupplyChainActor
addFixedCost, addRole, getBankAccount, getContentStore, getDEVSSimulator, getFixedCosts, removeRole, scheduledSendContent, scheduledSendContent, sendContent, setContentStore
 
Methods inherited from class nl.tudelft.simulation.actor.Actor
addContentHandler, addReceivingDevice, addReceivingDevice, addSendingDevice, checkReceivingDevice, getLocation, getLocationDescription, getReceivingDevices, getReceivingDevices, getSendingDevices, getSendingDevices, getSimulator, getSimulatorTime, handleMessage, removeContentHandler, removeReceivingDevice, removeSendingDevice, resolveFastestDevice, setCheckInterval, setLocationDescription, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface nl.tudelft.simulation.actor.ActorInterface
getReceivingDevices, getReceivingDevices, getSendingDevices, getSendingDevices, getSimulator, getSimulatorTime, handleMessage
 
Methods inherited from interface nl.tudelft.simulation.dsol.animation.LocatableInterface
getLocation
 
Methods inherited from interface nl.tudelft.simulation.content.HandlerInterface
handleContent
 

Constructor Detail

GameMarket

public GameMarket(java.lang.String name,
                  nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface simulator,
                  javax.vecmath.Point3d position,
                  nl.tudelft.simulation.supplychain.banking.Bank bank)
constructs a new GameMarket; used when dragging and dropping an actor

Parameters:
name - the name
simulator - the simulator
position - the position
bank - the bank

GameMarket

public GameMarket(java.lang.String name,
                  nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface simulator,
                  javax.vecmath.Point3d position,
                  nl.tudelft.simulation.supplychain.banking.Bank bank,
                  double initialBankAccount,
                  nl.tudelft.simulation.supplychain.product.Product[] product,
                  nl.tudelft.simulation.supplychain.demand.Demand[] demand,
                  nl.tudelft.simulation.supplychain.reference.Retailer[] retailer)
           throws java.rmi.RemoteException
constructs a new GameMarket

Parameters:
name - the name
simulator - the simulator
position - the position
bank - the bank
initialBankAccount - the initial bank account
product - the product
demand - the demand generators for the products
retailer - the retailer
Throws:
java.rmi.RemoteException - thrown in case of a network exception
Method Detail

init

public void init()
          throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException - thrown in case of a network error

getBounds

public javax.media.j3d.Bounds getBounds()
Specified by:
getBounds in interface nl.tudelft.simulation.dsol.animation.LocatableInterface
See Also:
LocatableInterface.getBounds()

getSmallMapLocation

public nl.tudelft.simulation.language.d3.DirectedPoint getSmallMapLocation()
Specified by:
getSmallMapLocation in interface GameActorInterface
Returns:
Returns the smallMapLocation.

setSmallMapLocation

public void setSmallMapLocation(nl.tudelft.simulation.language.d3.DirectedPoint smallMapLocation)
Parameters:
smallMapLocation - The smallMapLocation to set.

getName

public java.lang.String getName()
Specified by:
getName in interface nl.tudelft.simulation.actor.ActorInterface
See Also:
ActorInterface.getName()

getAnimation

protected GisActorAnimation getAnimation()
Returns:
Returns the animation

calculateDistance

public double calculateDistance(nl.tudelft.simulation.supplychain.actor.SupplyChainActor actor)
See Also:
SupplyChainActor.calculateDistance(nl.tudelft.simulation.supplychain.actor.SupplyChainActor)

changeDemand

public void changeDemand(nl.tudelft.simulation.supplychain.product.Product product,
                         boolean up,
                         double percentage)
Method changeDemand changes the demand of a PCMarket for the specified product.

Parameters:
product - the product to change the demand for
up - if true, demand will increase, if false, the demand will decrease
percentage - the percentage to change the demand with


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