Class BMWorld
- java.lang.Object
-
- org.spectrumauctions.sats.core.model.World
-
- org.spectrumauctions.sats.core.model.bvm.BMWorld
-
- All Implemented Interfaces:
java.io.Serializable,GenericWorld
public final class BMWorld extends World implements GenericWorld
- Author:
- Michael Weiss
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringMODEL_NAME
-
Constructor Summary
Constructors Constructor Description BMWorld(BMWorldSetup setup, RNGSupplier rngSupplier)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<BMBidder>createPopulation(java.util.Collection<BMBidderSetup> bidderSetups)java.util.List<BMBidder>createPopulation(java.util.Collection<BMBidderSetup> bidderSetups, long seed)java.util.List<BMBidder>createPopulation(java.util.Collection<BMBidderSetup> bidderSetups, RNGSupplier rngSupplier)java.util.List<BMBidder>createPopulation(BMBidderSetup bidderSetup)java.util.List<BMBidder>createPopulation(BMBidderSetup bidderSetup, long seed)java.util.List<BMBidder>createPopulation(BMBidderSetup bidderSetup, RNGSupplier rngSupplier)booleanequals(java.lang.Object obj)java.util.List<? extends GenericGood>getAllGenericDefinitions()BMBandgetBand(java.lang.String bandName)Gets a band with a specific namejava.util.List<BMBand>getBands()java.util.List<BMLicense>getLicenses()intgetNumberOfGoods()inthashCode()static BMWorldreadWorld(long worldId)voidrefreshFieldBackReferences()Some of the members of the World (e.g.java.util.List<BMBidder>restorePopulation(long populationId)Restore serializedSATSBidderinstances via population id-
Methods inherited from class org.spectrumauctions.sats.core.model.World
getId, getModelName, openNewPopulation, restorePopulation, restorePopulation, store
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.spectrumauctions.sats.core.model.GenericWorld
getGenericDefinitionOf
-
-
-
-
Field Detail
-
MODEL_NAME
public static final java.lang.String MODEL_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BMWorld
public BMWorld(BMWorldSetup setup, RNGSupplier rngSupplier)
-
-
Method Detail
-
getBand
public BMBand getBand(java.lang.String bandName)
Gets a band with a specific name- Parameters:
bandName- the band name to be queried- Returns:
- band with this name, null if no such band in this world
-
getBands
public java.util.List<BMBand> getBands()
- Returns:
- a list of all bands
-
getLicenses
public java.util.List<BMLicense> getLicenses()
- Specified by:
getLicensesin classWorld
-
getNumberOfGoods
public int getNumberOfGoods()
- Specified by:
getNumberOfGoodsin classWorld
-
createPopulation
public java.util.List<BMBidder> createPopulation(BMBidderSetup bidderSetup)
- Returns:
- a new population, i.e., a set of bidders, according to the specified bidderSetup
-
createPopulation
public java.util.List<BMBidder> createPopulation(BMBidderSetup bidderSetup, long seed)
- See Also:
createPopulation(BMBidderSetup)
-
createPopulation
public java.util.List<BMBidder> createPopulation(BMBidderSetup bidderSetup, RNGSupplier rngSupplier)
- See Also:
createPopulation(BMBidderSetup)
-
createPopulation
public java.util.List<BMBidder> createPopulation(java.util.Collection<BMBidderSetup> bidderSetups)
- Parameters:
bidderSetups- the collection of setups that are the basis for the new population- Returns:
- a new population, i.e., a set of bidders, according to the specified bidderSetups
-
createPopulation
public java.util.List<BMBidder> createPopulation(java.util.Collection<BMBidderSetup> bidderSetups, long seed)
- See Also:
createPopulation(Collection)
-
createPopulation
public java.util.List<BMBidder> createPopulation(java.util.Collection<BMBidderSetup> bidderSetups, RNGSupplier rngSupplier)
- See Also:
createPopulation(Collection)
-
readWorld
public static BMWorld readWorld(long worldId)
-
refreshFieldBackReferences
public void refreshFieldBackReferences()
Description copied from class:WorldSome of the members of the World (e.g. licenses) have circular references back to the world.
As the used gsonSerializer cannot handle this yet, the circular references are not serialized and have to be restored after deserialization by calling this method.
This method will be removed in a later version and the problem be solved during deserialization.- Specified by:
refreshFieldBackReferencesin classWorld
-
restorePopulation
public java.util.List<BMBidder> restorePopulation(long populationId)
Description copied from class:WorldRestore serializedSATSBidderinstances via population id- Specified by:
restorePopulationin classWorld- Parameters:
populationId- the population id- Returns:
- the deserialized bidders
-
getAllGenericDefinitions
public java.util.List<? extends GenericGood> getAllGenericDefinitions()
- Specified by:
getAllGenericDefinitionsin interfaceGenericWorld
-
-