net.sourceforge.jasa.report
Class DynamicSurplusReport
java.lang.Object
net.sourceforge.jasa.report.AbstractAuctionReport
net.sourceforge.jasa.report.AbstractMarketStatsReport
net.sourceforge.jasa.report.DynamicSurplusReport
- All Implemented Interfaces:
- java.io.Serializable, AuctionReport
- Direct Known Subclasses:
- PayoffReport
public class DynamicSurplusReport
- extends AbstractMarketStatsReport
A historicalDataReport that keeps track of the surplus available to each
agent in theoretical equilibrium. The equilibrium price is recomputed at the
end of each day, thus this class can be used to keep track of theoretically
available surplus even when supply and demand are changing over time. Each
agent is assumed to be hypothetically able to trade the specified quantity of
units in each day.
- See Also:
- Serialized Form
-
-
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
equilibriaStats
protected EquilibriumReportVariables equilibriaStats
- The historicalDataReport used to calculate the equilibrium price.
quantity
protected int quantity
- The quantity that each agent can theoretically trade per day. This should
normally be set equal to agents' trade entitlement.
efficiency
protected double efficiency
P_DEF_BASE
public static final java.lang.String P_DEF_BASE
- See Also:
- Constant Field Values
P_QUANTITY
public static final java.lang.String P_QUANTITY
- See Also:
- Constant Field Values
VAR_EFFICIENCY
public static final ReportVariable VAR_EFFICIENCY
DynamicSurplusReport
public DynamicSurplusReport()
setAuction
public void setAuction(Market auction)
- Overrides:
setAuction
in class AbstractAuctionReport
calculate
public void calculate()
- Description copied from class:
AbstractMarketStatsReport
- Perform final calculations at the end of the market.
- Specified by:
calculate
in class AbstractMarketStatsReport
getEfficiency
public double getEfficiency()
compute
public void compute(SimEvent event)
getEquilibriumProfits
public double getEquilibriumProfits(AbstractTradingAgent agent)
calculateTotalEquilibriumSurplus
public double calculateTotalEquilibriumSurplus()
calculateTotalProfits
public double calculateTotalProfits()
updateStats
protected void updateStats(AbstractTradingAgent agent,
double lastSurplus)
- Increment the surplus available to the specified agent by the specified
amount.
equilibriumSurplus
protected double equilibriumSurplus(TokenTradingAgent agent,
double ep,
int quantity)
- Calculate the surplus available to the specified agent given the specified
equilibrium price and quantity.
- Parameters:
agent
- The agent to calculate theoretically available surplus to.ep
- The hypothetical equilibrium pricequantity
- The hypothetical quantity that this agent is able to trade in any
given day.
initialise
public void initialise()
reset
public void reset()
produceUserOutput
public void produceUserOutput()
- Overrides:
produceUserOutput
in class AbstractAuctionReport
getVariableBindings
public java.util.Map<java.lang.Object,java.lang.Number> getVariableBindings()
- Overrides:
getVariableBindings
in class AbstractAuctionReport
getQuantity
public int getQuantity()
setQuantity
public void setQuantity(int quantity)