Class BMBidder
- java.lang.Object
-
- org.spectrumauctions.sats.core.model.SATSBidder
-
- org.spectrumauctions.sats.core.model.bvm.BMBidder
-
- All Implemented Interfaces:
java.io.Serializable,org.marketdesignresearch.mechlib.core.bidder.Bidder,org.marketdesignresearch.mechlib.instrumentation.MipInstrumentationable
public final class BMBidder extends SATSBidder
- Author:
- Michael Weiss
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.spectrumauctions.sats.core.model.SATSBidder
DEFAULT_DEMAND_QUERY_EPSILON, DEFAULT_DEMAND_QUERY_TIME_LIMIT
-
-
Constructor Summary
Constructors Constructor Description BMBidder(long population, int bidderId, BMWorld world, BMBidderSetup setup, UniformDistributionRNG rng)Create a new bidder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.math.BigDecimalcalculateValue(org.marketdesignresearch.mechlib.core.Bundle bundle)Returns the value this bidder has for a specific bundle.protected booleancanEqual(java.lang.Object other)SATSBidderdrawSimilarBidder(RNGSupplier rngSupplier)booleanequals(java.lang.Object o)java.math.BigDecimalgetBaseValue(BMBand band)java.util.LinkedHashSet<org.marketdesignresearch.mechlib.core.Bundle>getBestBundles(org.marketdesignresearch.mechlib.core.price.Prices prices, int maxNumberOfBundles, boolean allowNegative)<T extends BiddingLanguage>
TgetValueFunction(java.lang.Class<T> clazz, RNGSupplier rngSupplier)BMWorldgetWorld()inthashCode()inthighestSynergyQuantity(BMBand band)voidrefreshReference(World world)To prevent from creating too many identical world instances, worlds are not serialized and deserialized with the bidder
As a temporary solution, the world instance is re-added after deserialization by calling this method.
This method will be removed in a later version and be done automatically during deserialization.java.math.BigDecimalsynergyFactor(BMBand band, int quantity)Returns the synergy factor for a given band and quantity.-
Methods inherited from class org.spectrumauctions.sats.core.model.SATSBidder
getDescription, getId, getLongId, getMipInstrumentation, getName, getPopulation, getSetup, getSetupType, getShortDescription, getStrategy, getValue, getValueFunction, getValueFunction, getWorldId, setMipInstrumentation, setStrategy, store, toString
-
-
-
-
Constructor Detail
-
BMBidder
public BMBidder(long population, int bidderId, BMWorld world, BMBidderSetup setup, UniformDistributionRNG rng)Create a new bidder. The use of this constructor is not recommended. UseBMWorld.createPopulation(java.util.Collection)instead, to create new bidder sets.
-
-
Method Detail
-
synergyFactor
public java.math.BigDecimal synergyFactor(BMBand band, int quantity)
Returns the synergy factor for a given band and quantity. Special Cases (rules apply in this order):
- returns 1 for quantity 1
- returns 0 for quantity 0
- If no synergy factors stored for band, returns 1
- The highest explicitely stored quantity is defined as the upper limit of items with synergies, seehighestSynergyQuantity(BMBand).
- If quantity has no specified synergy factor, the synergy factor for next lower known quantity is returned.
-
getBaseValue
public java.math.BigDecimal getBaseValue(BMBand band)
-
highestSynergyQuantity
public int highestSynergyQuantity(BMBand band)
- Returns:
- the maximal number of items within a band, for which synergies
apply. For additional items in the same band, only their base value
(without synergies) is added to the total value, if they are not excluded by the
positiveValueThreshold.
-
drawSimilarBidder
public SATSBidder drawSimilarBidder(RNGSupplier rngSupplier)
- Specified by:
drawSimilarBidderin classSATSBidder
-
getWorld
public BMWorld getWorld()
- Specified by:
getWorldin classSATSBidder- Returns:
- World to which this bidder belongs. The implementing Bidder class, overriding this method, should return a world type corresponding to the specific model.
- See Also:
SATSBidder.getWorld()
-
getValueFunction
public <T extends BiddingLanguage> T getValueFunction(java.lang.Class<T> clazz, RNGSupplier rngSupplier) throws UnsupportedBiddingLanguageException
- Specified by:
getValueFunctionin classSATSBidder- Throws:
UnsupportedBiddingLanguageException
-
refreshReference
public void refreshReference(World world)
Description copied from class:SATSBidderTo prevent from creating too many identical world instances, worlds are not serialized and deserialized with the bidder
As a temporary solution, the world instance is re-added after deserialization by calling this method.
This method will be removed in a later version and be done automatically during deserialization.- Specified by:
refreshReferencein classSATSBidder- See Also:
SATSBidder.refreshReference(World)
-
calculateValue
public java.math.BigDecimal calculateValue(org.marketdesignresearch.mechlib.core.Bundle bundle)
Description copied from class:SATSBidderReturns the value this bidder has for a specific bundle.- Specified by:
calculateValuein classSATSBidder- Parameters:
bundle- the bundle for which the value is asked- Returns:
- bidder specific value for this bundle
-
getBestBundles
public java.util.LinkedHashSet<org.marketdesignresearch.mechlib.core.Bundle> getBestBundles(org.marketdesignresearch.mechlib.core.price.Prices prices, int maxNumberOfBundles, boolean allowNegative)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classSATSBidder
-
canEqual
protected boolean canEqual(java.lang.Object other)
- Overrides:
canEqualin classSATSBidder
-
hashCode
public int hashCode()
- Overrides:
hashCodein classSATSBidder
-
-