|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SupplierModel
public class SupplierModel
Keeps track of a single supplier and component. There will be two objects per supplier (e.g., pintel will have one both CPU types). Reputation is tracked, predictions can be made about prices the supplier will offer in response to RFQs, and deliveries can be predicted. The ComponentInfo object will update this object at the start of each day with information about offers made and components delivered, and at the end of each day with the offers accepted.
Field Summary | |
---|---|
private int |
basePrice
|
private double |
capacity
|
private int |
componentIndex
|
(package private) static double |
cpuAPR
|
private int |
date
|
private double[] |
fractionCommitted
|
private int[] |
fractionCommittedDates
|
(package private) static int |
initialAverageCapacity
|
(package private) static int |
initialReputationQuantity
|
private java.util.Hashtable |
myOrders
|
private java.lang.String |
name
|
(package private) static double |
otherAPR
|
private int |
productId
|
private static java.util.Hashtable |
quantityOffered
|
private static java.util.Hashtable |
quantityOrdered
|
private double |
reputation
|
(package private) static int |
reputationRecovery
|
Constructor Summary | |
---|---|
SupplierModel(int componentIndex,
int productId,
java.lang.String name,
int basePrice)
|
Method Summary | |
---|---|
void |
addDelivery(OrderInfo order,
int todaysDate)
Records a delivery from the supplier. |
void |
addOrder(OrderInfo order,
int todaysDate)
Record an order from this supplier, and update reputation. |
double |
calculatePrice(int dueDate,
double quantity)
Predicts the price (per component) that will be offered for an RFQ with the given due date and quantity. |
int[] |
getExpectedDeliveries()
Returns an array indicating the expected future deliveries from the supplier. |
java.lang.String |
getName()
Returns the supplier's name. |
int |
getProductID()
Returns the product ID |
double |
getSpareOffers()
Returns the amount by which offers could be increased without the reputation dropping below 1. |
void |
processMarketReport(se.sics.tasim.props.MarketReport mr)
Processes a periodic (every 20 days) market report. |
void |
update(int date,
java.util.Vector offers)
Updates estimates of the supplier's fraction of capacity used. |
void |
updateReputation(java.util.Vector orders,
java.util.Vector offers)
Updates the reputation with this supplier. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final int initialAverageCapacity
static final int initialReputationQuantity
static final double cpuAPR
static final double otherAPR
static final int reputationRecovery
private int componentIndex
private int productId
private java.lang.String name
private int basePrice
private double capacity
private static java.util.Hashtable quantityOrdered
private static java.util.Hashtable quantityOffered
private double reputation
private double[] fractionCommitted
private int[] fractionCommittedDates
private java.util.Hashtable myOrders
private int date
Constructor Detail |
---|
public SupplierModel(int componentIndex, int productId, java.lang.String name, int basePrice)
componentIndex
- index (0-9)productId
- (e.g., 301)name
- supplier namebasePrice
- the component's base priceMethod Detail |
---|
public java.lang.String getName()
public int getProductID()
public void update(int date, java.util.Vector offers)
date
- today's dateoffers
- a vector of offerspublic void processMarketReport(se.sics.tasim.props.MarketReport mr)
mr
- the market reportpublic void addOrder(OrderInfo order, int todaysDate)
order
- a single ordertodaysDate
- the datepublic void updateReputation(java.util.Vector orders, java.util.Vector offers)
orders
- a vector with the day's ordersoffers
- a vector with the day's offerspublic double getSpareOffers()
public void addDelivery(OrderInfo order, int todaysDate)
order
- the order that was deliveredtodaysDate
- public double calculatePrice(int dueDate, double quantity)
dueDate
- when delivery is requestedquantity
- the quantity requested
public int[] getExpectedDeliveries()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |