Class ComputerInfo

java.lang.Object
  extended by ComputerInfo

public class ComputerInfo
extends java.lang.Object

Holds all information pertaining to computers. 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 delivery schedule is sent that is not feasible given the computers available, the problem will not be detected.


Field Summary
 int[][] averageOfferPrice
          avg bid per computer type each day
 int[] basePrices
          base prices for each computer: sum of component base prices
private static int columnWidth
          width of columns in summary table
 int[][] componentIndexList
          list of components for each computer, stored by index instead of ID
 int[] dailyRFQCount
          total number of RFQs per day
private  int date
           
 int[][] delivered
          number delivered each day
 int[][] highPrice
          high price from each day's product report
 int[] highSegmentRFQCount
          number of RFQs per day in high segment
 int[][] inventory
          number of computers in inventory each day
 int[][] lowPrice
          low price from each day's product report
 int[] lowSegmentRFQCount
          number of RFQs per day in low segment
 int[] midSegmentRFQCount
          number of RFQs per day in mid segment
private  int numComputers
           
private  int numDays
           
 int[][] offerNumber
          total number of computers offered each day
 int[][] offerPrice
          sum of all offers each day
 java.util.Hashtable offerTable
          stores all offers
 int[][] orderNumber
          number of computers ordered each day
 int[][] orderPrice
          total price for all computers ordered each day
 java.util.Hashtable orderTable
          stores current orders
 int[][] produced
          computers produced each day
 int[] productIDs
          product IDs for each index
 int[][] rfqNumber
          total computers in all rfqs each day
 java.util.Hashtable rfqTable
          stores current RFQs
private  GameSettings settings
           
 int[] tomorrowsInventory
          number of computers available for delivery tomorrow
 int[] totalOrders
          total number of each computer currently ordered
 int[][] wholeOfferNumber
          total number of offers made each day
 int[][] wholeOrderNumber
          total number of orders each day
 int[][] wholeRfqNumber
          number of RFQs received for each type of computer
 java.util.Vector[] yesterdaysOffers
          offers made yesterday for each computer type
 
Constructor Summary
ComputerInfo(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 computer information.
private  java.lang.String getDecimal(double d, int length)
           
 int getIndex(int productID)
          Returns the index for the productID
 int[] getTomorrowsInventoryCopy()
          Returns a copy of tomorrow's available computers (including computers being produced on the current day)
 void morningUpdate(DailyInfo dayInfo)
          Updates the computer 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

dailyRFQCount

public int[] dailyRFQCount
total number of RFQs per day


highSegmentRFQCount

public int[] highSegmentRFQCount
number of RFQs per day in high segment


midSegmentRFQCount

public int[] midSegmentRFQCount
number of RFQs per day in mid segment


lowSegmentRFQCount

public int[] lowSegmentRFQCount
number of RFQs per day in low segment


wholeRfqNumber

public int[][] wholeRfqNumber
number of RFQs received for each type of computer


rfqNumber

public int[][] rfqNumber
total computers in all rfqs each day


offerNumber

public int[][] offerNumber
total number of computers offered each day


wholeOfferNumber

public int[][] wholeOfferNumber
total number of offers made each day


offerPrice

public int[][] offerPrice
sum of all offers each day


orderNumber

public int[][] orderNumber
number of computers ordered each day


wholeOrderNumber

public int[][] wholeOrderNumber
total number of orders each day


averageOfferPrice

public int[][] averageOfferPrice
avg bid per computer type each day


orderPrice

public int[][] orderPrice
total price for all computers ordered each day


inventory

public int[][] inventory
number of computers in inventory each day


tomorrowsInventory

public int[] tomorrowsInventory
number of computers available for delivery tomorrow


produced

public int[][] produced
computers produced each day


delivered

public int[][] delivered
number delivered each day


totalOrders

public int[] totalOrders
total number of each computer currently ordered


highPrice

public int[][] highPrice
high price from each day's product report


lowPrice

public int[][] lowPrice
low price from each day's product report


productIDs

public int[] productIDs
product IDs for each index


rfqTable

public java.util.Hashtable rfqTable
stores current RFQs


offerTable

public java.util.Hashtable offerTable
stores all offers


orderTable

public java.util.Hashtable orderTable
stores current orders


yesterdaysOffers

public java.util.Vector[] yesterdaysOffers
offers made yesterday for each computer type


componentIndexList

public int[][] componentIndexList
list of components for each computer, stored by index instead of ID


basePrices

public int[] basePrices
base prices for each computer: sum of component base prices


settings

private GameSettings settings

columnWidth

private static final int columnWidth
width of columns in summary table

See Also:
Constant Field Values

numComputers

private int numComputers

numDays

private int numDays

date

private int date
Constructor Detail

ComputerInfo

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

getTomorrowsInventoryCopy

public int[] getTomorrowsInventoryCopy()
Returns a copy of tomorrow's available computers (including computers being produced on the current day)

Returns:
array with quantity of each computer

getDailySummary

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

Returns:
summary table

getIndex

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

Parameters:
productID -
Returns:
index (0-15)

morningUpdate

public void morningUpdate(DailyInfo dayInfo)
Updates the computer 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

pad

private java.lang.String pad(int i)

pad

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

getDecimal

private java.lang.String getDecimal(double d,
                                    int length)