public class PointBid extends Bid implements java.lang.Iterable<PricePoint>
Bid
with a PricePoint
array to represent the bid curve. This
is used by Agent
s that have to create a Bid
, because it is easier to create.Modifier and Type | Class and Description |
---|---|
static class |
PointBid.Builder
A builder class to create an
PointBid instance. |
marketBasis, SMALLEST_DEMAND
Constructor and Description |
---|
PointBid(MarketBasis marketBasis,
PricePoint... pricePoints)
A constructor to create an instance of PointBid.
|
Modifier and Type | Method and Description |
---|---|
ArrayBid |
aggregate(Bid other)
Aggregates this
Bid instance with another Bid. |
Price |
calculateIntersection(double targetDemand)
Calculates the
Price at the intersection with the bid curve at the given demand. |
boolean |
equals(java.lang.Object obj) |
double |
getDemandAt(Price price)
Calculates the demand at the intersection in the bid curve with the priceStep in a demand array.
|
double |
getMaximumDemand() |
double |
getMinimumDemand() |
PricePoint[] |
getPricePoints() |
int |
hashCode() |
java.util.Iterator<PricePoint> |
iterator() |
ArrayBid |
toArrayBid() |
PointBid |
toPointBid() |
java.lang.String |
toString() |
demandIsEqual, flatDemand, getDemandAt, getMarketBasis
public PointBid(MarketBasis marketBasis, PricePoint... pricePoints)
marketBasis
- the MarketBasis
of the clusterpricePoints
- the PointBid
Array that belongs to this bid.public ArrayBid aggregate(Bid other)
Bid
instance with another Bid. Bid are aggregated by adding their bid curves.public Price calculateIntersection(double targetDemand)
Price
at the intersection with the bid curve at the given demand.calculateIntersection
in class Bid
targetDemand
- the part of the bid curve you want to get the Price
of.Price
public double getMaximumDemand()
getMaximumDemand
in class Bid
public double getMinimumDemand()
getMinimumDemand
in class Bid
public ArrayBid toArrayBid()
toArrayBid
in class Bid
ArrayBid
implementation of this Bid.public PointBid toPointBid()
toPointBid
in class Bid
PointBid
implementation of this Bid.public double getDemandAt(Price price)
Bid.getDemandAt(PriceStep)
method.
The default implementation is to call the other.getDemandAt
in class Bid
price
- the Price
you want to know the demand of.public java.util.Iterator<PricePoint> iterator()
iterator
in interface java.lang.Iterable<PricePoint>
public PricePoint[] getPricePoints()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object