Class ComponentInfo

java.lang.Object
  extended by ComponentInfo

public class ComponentInfo
extends java.lang.Object

Holds all information pertaining to components. The information is updated by using the incoming messages at the beginning of each day and the outgoing messages at the end of each day. This means that there is no need to modify any values during the agent's decision making process, and so this object should essentially be read-only during the day. (But fields have been left public to allow easy access - too much work to add get-methods for everything!) Note that this object is not responsible for verifying messages. For example, if a production schedule is sent that is not feasible given the components available, the problem will not be detected.


Field Summary
 int[] basePrices
          component base prices
private static int columnWidth
          width of summary table columns
 java.util.Hashtable[] currentOrders
          a list of orders that have not been delivered for each component
 int[][] deliveries
          completed deliveries
 int[][] expectedDeliveries
          expected future deliveries
 int[][] inventory
          inventory each day
private  int numComponents
           
private  int numDays
           
 java.util.Hashtable offerTable
          stores offers by offerID
 int[][] orderedToday
          number ordered each day
 int[] orderedTotal
          total number currently ordered
 java.util.Vector[] ordersByDate
          a list of all orders for each component, in order of date
 int[] productIDs
          ID for each index
 java.util.Hashtable rfqTable
          stores RFQs by rfqID
private  GameSettings settings
           
 SupplierModel[][] supplierModel
          information on each supplier line, as [component][supplier]
 java.util.Vector todaysOffers
          list of all offers
 java.util.Vector[] todaysOrders
          list of orders for each component
 java.util.Vector[][] todaysSortedOffers
          offers sorted by date, divided into [component][supplier]
 int[] tomorrowsInventory
          tomorrow's available inventory (including today's deliveries, which aren't included in today's inventory)
 int[][] used
          used each day
 
Constructor Summary
ComponentInfo(GameSettings settings)
           
 
Method Summary
 void eveningUpdate(int date, DailyActions actions)
          Updates the component information using today's outgoing messages (actions taken by the agent).
 java.lang.String getDailySummary(int date)
          Generates a compact table summarizing today's component information.
 int getIndex(int productID)
          Returns the index for the productID
 int[] getTomorrowsInventoryCopy()
          Returns a copy of tomorrow's available inventory (including components delivered today).
 void morningUpdate(DailyInfo dayInfo)
          Updates the component information using today's incoming messages.
private  java.lang.String pad(int i)
           
private  java.lang.String pad(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

deliveries

public int[][] deliveries
completed deliveries


expectedDeliveries

public int[][] expectedDeliveries
expected future deliveries


inventory

public int[][] inventory
inventory each day


tomorrowsInventory

public int[] tomorrowsInventory
tomorrow's available inventory (including today's deliveries, which aren't included in today's inventory)


used

public int[][] used
used each day


orderedToday

public int[][] orderedToday
number ordered each day


orderedTotal

public int[] orderedTotal
total number currently ordered


basePrices

public int[] basePrices
component base prices


productIDs

public int[] productIDs
ID for each index


rfqTable

public java.util.Hashtable rfqTable
stores RFQs by rfqID


currentOrders

public java.util.Hashtable[] currentOrders
a list of orders that have not been delivered for each component


offerTable

public java.util.Hashtable offerTable
stores offers by offerID


todaysOffers

public java.util.Vector todaysOffers
list of all offers


todaysOrders

public java.util.Vector[] todaysOrders
list of orders for each component


ordersByDate

public java.util.Vector[] ordersByDate
a list of all orders for each component, in order of date


todaysSortedOffers

public java.util.Vector[][] todaysSortedOffers
offers sorted by date, divided into [component][supplier]


supplierModel

public SupplierModel[][] supplierModel
information on each supplier line, as [component][supplier]


settings

private GameSettings settings

columnWidth

private static final int columnWidth
width of summary table columns

See Also:
Constant Field Values

numComponents

private int numComponents

numDays

private int numDays
Constructor Detail

ComponentInfo

public ComponentInfo(GameSettings settings)
Parameters:
settings - the game settings
Method Detail

getTomorrowsInventoryCopy

public int[] getTomorrowsInventoryCopy()
Returns a copy of tomorrow's available inventory (including components delivered today).

Returns:
array with quantity of each component

getDailySummary

public java.lang.String getDailySummary(int date)
Generates a compact table summarizing today's component information.

Returns:
summary table

morningUpdate

public void morningUpdate(DailyInfo dayInfo)
Updates the component information using today's incoming messages.

Parameters:
dayInfo - information received today

eveningUpdate

public void eveningUpdate(int date,
                          DailyActions actions)
Updates the component information using today's outgoing messages (actions taken by the agent).

Parameters:
date - the date
actions - the agent's actions for the day

getIndex

public int getIndex(int productID)
Returns the index for the productID

Parameters:
productID - (e.g., 101)
Returns:
index (0-9)

pad

private java.lang.String pad(int i)

pad

private java.lang.String pad(java.lang.String s)