player
Class ZIFirm

java.lang.Object
  extended by player.Player
      extended by player.ZIPlayer
          extended by player.ZIFirm

public class ZIFirm
extends ZIPlayer

ZIFirm represents a firm with a Zero Intelligence strategy to buying and selling goods, including ones that they may produce. It is assumed that a ZIfirm is under some form of emission control which requires a certain permit to produce output. Thus, upon creation of a ZIFirm, the commodity that this firm is producing and the permits it requires must be specified.

Author:
tratch

Constructor Summary
ZIFirm(java.lang.String pName, boolean constraint, java.lang.String type, Commodity pCommodity, Commodity pPermit)
           
 
Method Summary
 void adjustCapacity()
          Changes output capacity by randomly adding 1 or subtracting 1 from the current capacity.
 void calibrateOutputCapacity()
          Resets the output capacity to that of the target capacity
 void clearOutputCapacity()
          Sets the output capacity to 0
 int getEmissionRate()
           
 Commodity getEmissionsPermit()
           
 java.lang.String getFirmType()
           
 double getLastOutputTrade()
           
 int getOutputCapacity()
           
 Commodity getProduct()
           
 int getTargetCapacity()
           
 void produceOutput()
          Simulates production by simply adding an amount equal to the output capacity of the firm's product to the firm's inventory if there are enough emissionsPermits to permit it.
 void setLastOutputTrade(double lastOutputTrade)
           
 void setOutputCapacity(int outputCapacity)
           
 void setTargetCapacity(int pTargetCapacity)
          Sets the current output capacity for this firm.
 
Methods inherited from class player.ZIPlayer
isConstrained, makeAsk, makeBid, setConstrained
 
Methods inherited from class player.Player
addToInventory, browseInventory, clearFromInventory, clearInventory, clearValueFunction, getInventory, getPlayerName, getValue, printInventory, removeFromInventory, setBudget, setPlayerName, setValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZIFirm

public ZIFirm(java.lang.String pName,
              boolean constraint,
              java.lang.String type,
              Commodity pCommodity,
              Commodity pPermit)
Parameters:
pName -
constraint -
type -
pCommodity -
pPermit -
Method Detail

adjustCapacity

public void adjustCapacity()
Changes output capacity by randomly adding 1 or subtracting 1 from the current capacity. The probability


getEmissionRate

public int getEmissionRate()
Returns:
the firms emission rate

getTargetCapacity

public int getTargetCapacity()
Returns:
the output capacity for this firm

produceOutput

public void produceOutput()
Simulates production by simply adding an amount equal to the output capacity of the firm's product to the firm's inventory if there are enough emissionsPermits to permit it.


setTargetCapacity

public void setTargetCapacity(int pTargetCapacity)
Sets the current output capacity for this firm. If the new capacity is below 0, this method sets the output capacity to 0.

Parameters:
pTargetCapacity -

getFirmType

public java.lang.String getFirmType()
Returns:
What type of Firm this is

getProduct

public Commodity getProduct()
Returns:
The product this firm is outputting

getEmissionsPermit

public Commodity getEmissionsPermit()
Returns:
The emission permit required

getLastOutputTrade

public double getLastOutputTrade()
Returns:
The price of the last unit of output that was traded

setLastOutputTrade

public void setLastOutputTrade(double lastOutputTrade)
Parameters:
lastOutputTrade -

getOutputCapacity

public int getOutputCapacity()
Returns:
This firm's outputCapacity

calibrateOutputCapacity

public void calibrateOutputCapacity()
Resets the output capacity to that of the target capacity


clearOutputCapacity

public void clearOutputCapacity()
Sets the output capacity to 0


setOutputCapacity

public void setOutputCapacity(int outputCapacity)
Parameters:
outputCapacity -