Class World
- java.lang.Object
-
- org.spectrumauctions.sats.core.model.World
-
-
Constructor Summary
Constructors Constructor Description World(java.lang.String modelName)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)longgetId()abstract java.util.List<? extends License>getLicenses()java.lang.StringgetModelName()abstract intgetNumberOfGoods()inthashCode()protected longopenNewPopulation()abstract voidrefreshFieldBackReferences()Some of the members of the World (e.g.abstract java.util.List<? extends SATSBidder>restorePopulation(long populationId)Restore serializedSATSBidderinstances via population idprotected <T extends SATSBidder>
java.util.List<T>restorePopulation(java.lang.Class<T> type, long populationId)<T extends SATSBidder>
java.util.List<T>restorePopulation(java.lang.Class<T> type, long populationId, InstanceHandler storageHandler)Advanced way to restore serializedSATSBidderinstances, allowing to specify a customInstanceHandler
For most use cases, it's recommended to useBMWorld.restorePopulation(long).protected voidstore()
-
-
-
Method Detail
-
getModelName
public java.lang.String getModelName()
-
getId
public long getId()
-
getNumberOfGoods
public abstract int getNumberOfGoods()
-
getLicenses
public abstract java.util.List<? extends License> getLicenses()
-
store
protected void store()
-
openNewPopulation
protected long openNewPopulation()
-
restorePopulation
public abstract java.util.List<? extends SATSBidder> restorePopulation(long populationId)
Restore serializedSATSBidderinstances via population id- Parameters:
populationId- the population id- Returns:
- the deserialized bidders
-
restorePopulation
public <T extends SATSBidder> java.util.List<T> restorePopulation(java.lang.Class<T> type, long populationId, InstanceHandler storageHandler)
Advanced way to restore serializedSATSBidderinstances, allowing to specify a customInstanceHandler
For most use cases, it's recommended to useBMWorld.restorePopulation(long).
Note: Bidders and World must have been serialized before, either during construction (by having setInstanceHandler.setDefaultHandler(InstanceHandler)to an appropriate handler or by manually storing them with anInstanceHandlerafterwards. Restoring (deserialization) has to be done with the same type ofInstanceHandleras the serialization.- Parameters:
type- the bidder typepopulationId- the population idstorageHandler- the instance handler- Returns:
- the deserialized bidders
-
restorePopulation
protected <T extends SATSBidder> java.util.List<T> restorePopulation(java.lang.Class<T> type, long populationId)
-
refreshFieldBackReferences
public abstract void refreshFieldBackReferences()
Some 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.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-