|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectse.sics.tasim.tac05.Parser
PredictionParser
public class PredictionParser
Parses a single game log. All incoming and outgoing messages for the specified agent are stored, along with all prices for which predictions are needed. The predictor is then called with each day's information, and the predictions are evaluated.
| Field Summary | |
|---|---|
private java.lang.String |
agentName
|
(package private) se.sics.tasim.props.BOMBundle |
bom
|
(package private) se.sics.tasim.props.ComponentCatalog |
catalog
|
(package private) int[] |
componentBasePrices
|
(package private) int[] |
componentIDs
|
(package private) int[][] |
componentIndexList
|
(package private) int |
componentPredictionCount
|
(package private) double |
componentPredictionSquaredError
|
(package private) int[] |
computerBasePrices
|
(package private) int[] |
computerIDs
|
(package private) int |
computerPredictionCount
|
(package private) double |
computerPredictionSquaredError
|
(package private) java.util.Hashtable |
customerOffers
|
(package private) java.util.Vector[] |
customerOrders
|
(package private) java.util.Hashtable |
customerRFQs
|
(package private) int |
date
|
(package private) int |
futureComponentPredictionCount
|
(package private) double |
futureComponentPredictionSquaredError
|
(package private) int |
futureComputerPredictionCount
|
(package private) double |
futureComputerPredictionSquaredError
|
private java.util.Vector[] |
futureRFQs
|
(package private) double[][] |
medianPrice
|
private java.util.Vector[] |
messagesIn
|
private java.util.Vector[] |
messagesOut
|
(package private) static int |
N_COMPONENT
|
(package private) static int |
N_COMPUTER
|
(package private) static int |
numComponents
|
(package private) static int |
numComputers
|
(package private) static int |
numDays
|
(package private) se.sics.tasim.logtool.ParticipantInfo[] |
participants
|
private SCMPredictor |
predictor
|
(package private) double[] |
results
|
(package private) java.util.Vector[] |
supplierOffers
|
(package private) java.util.Hashtable |
supplierOrders
|
(package private) java.util.Hashtable |
supplierRFQs
|
(package private) java.util.Vector[] |
todaysPrices
|
private boolean |
verbose
|
| Fields inherited from interface se.sics.tasim.tac05.TAC05Constants |
|---|
CUSTOMER, DU_BANK_ACCOUNT, DU_CAPACITY_FLAG, DU_COMPONENT_ID_FLAG, DU_COMPONENT_PRICE_FLAG, DU_CUSTOMER_DEMAND, DU_CUSTOMER_ORDERED, DU_INVENTORY_FLAG, DU_NOMINAL_CAPACITY_FLAG, DU_PRODUCTION_FLAG, FACTORY, MANUFACTURER, ROLE_NAME, SIMULATION_TYPE, SUPPLIER, TYPE_DELIVERY, TYPE_MESSAGE, TYPE_NEGOTIATION, TYPE_NONE, TYPE_ORDER, TYPE_WARNING |
| Constructor Summary | |
|---|---|
PredictionParser(se.sics.tasim.logtool.LogReader reader,
java.lang.String agentName,
SCMPredictor predictor,
boolean verbose,
double[] results)
Called by the main class for each game. |
|
| Method Summary | |
|---|---|
protected void |
dataUpdated(int type,
se.sics.isl.transport.Transportable content)
BOMBundle, ComponentCatalog, and StartInfo are given here, instead of with the messages |
private int |
getComponentIndex(int productID)
Returns the index for the productID. |
private int |
getComputerIndex(int productID)
Returns the index for the productID. |
private void |
getMedianPrices()
Calculates the median prices for each computer type each day. |
private void |
getPredictions()
After the game is parsed, this will get the daily predictions from the predictor. |
private void |
handleCOffer(int sender,
int receiver,
se.sics.tasim.props.OfferBundle content)
Stores offers from customers. |
private void |
handleCOrder(int sender,
int receiver,
se.sics.tasim.props.OrderBundle content)
Stores orders from customers. |
private void |
handleCRFQ(int sender,
int receiver,
se.sics.tasim.props.RFQBundle content)
|
private void |
handleSOffer(int sender,
int receiver,
se.sics.tasim.props.OfferBundle content)
Stores offers from suppliers. |
private void |
handleSRFQ(int sender,
int receiver,
se.sics.tasim.props.RFQBundle content)
Stores RFQs to suppliers. |
protected void |
message(int sender,
int receiver,
se.sics.isl.transport.Transportable content)
Called each time a message is read from the game log. |
protected void |
nextDay(int somedate,
long serverTime)
Called each time a new day is reached in the game log |
private java.lang.String |
pad(double d)
Used for formatting output. |
protected void |
parseStopped()
Called at the end of the game. |
private void |
setup()
Sets up information using the catalog and BOM. |
| Methods inherited from class se.sics.tasim.tac05.Parser |
|---|
data, dataUpdated, dataUpdated, dataUpdated, dataUpdated, dataUpdated, getReader, interest, messageToRole, parseStarted, penalty, reputation, start, stop, storageCost, transaction, unhandledNode |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static final int N_COMPUTER
static final int N_COMPONENT
static final int numDays
static final int numComputers
static final int numComponents
private java.lang.String agentName
private boolean verbose
private java.util.Vector[] messagesIn
private java.util.Vector[] messagesOut
private java.util.Vector[] futureRFQs
private SCMPredictor predictor
int date
se.sics.tasim.logtool.ParticipantInfo[] participants
se.sics.tasim.props.BOMBundle bom
se.sics.tasim.props.ComponentCatalog catalog
int[] computerIDs
int[] componentIDs
int[][] componentIndexList
int[] computerBasePrices
int[] componentBasePrices
double[][] medianPrice
java.util.Vector[] todaysPrices
java.util.Vector[] supplierOffers
java.util.Hashtable supplierOrders
java.util.Hashtable supplierRFQs
java.util.Hashtable customerOffers
java.util.Vector[] customerOrders
java.util.Hashtable customerRFQs
int futureComputerPredictionCount
double futureComputerPredictionSquaredError
int computerPredictionCount
double computerPredictionSquaredError
int futureComponentPredictionCount
double futureComponentPredictionSquaredError
int componentPredictionCount
double componentPredictionSquaredError
double[] results
| Constructor Detail |
|---|
public PredictionParser(se.sics.tasim.logtool.LogReader reader,
java.lang.String agentName,
SCMPredictor predictor,
boolean verbose,
double[] results)
reader - reads the game logagentName - the agent for which predictions are madepredictor - makes predictionsverbose - whether to output all predictionsresults - accuracy results to be returned| Method Detail |
|---|
protected void message(int sender,
int receiver,
se.sics.isl.transport.Transportable content)
message in class se.sics.tasim.tac05.Parser
protected void dataUpdated(int type,
se.sics.isl.transport.Transportable content)
dataUpdated in class se.sics.tasim.tac05.Parser
protected void nextDay(int somedate,
long serverTime)
nextDay in class se.sics.tasim.tac05.Parserprotected void parseStopped()
parseStopped in class se.sics.tasim.tac05.Parserprivate void getPredictions()
private void setup()
private void handleCRFQ(int sender,
int receiver,
se.sics.tasim.props.RFQBundle content)
private void handleCOffer(int sender,
int receiver,
se.sics.tasim.props.OfferBundle content)
private void handleCOrder(int sender,
int receiver,
se.sics.tasim.props.OrderBundle content)
private void handleSRFQ(int sender,
int receiver,
se.sics.tasim.props.RFQBundle content)
private void handleSOffer(int sender,
int receiver,
se.sics.tasim.props.OfferBundle content)
private void getMedianPrices()
private int getComponentIndex(int productID)
private int getComputerIndex(int productID)
private java.lang.String pad(double d)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||