Class World

    • Field Detail

      • modelName

        protected final java.lang.String modelName
      • id

        protected final long id
    • Constructor Detail

      • World

        public World​(java.lang.String modelName)
    • 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 serialized SATSBidder instances 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 serialized SATSBidder instances, allowing to specify a custom InstanceHandler
        For most use cases, it's recommended to use BMWorld.restorePopulation(long).

        Note: Bidders and World must have been serialized before, either during construction (by having set InstanceHandler.setDefaultHandler(InstanceHandler) to an appropriate handler or by manually storing them with an InstanceHandler afterwards. Restoring (deserialization) has to be done with the same type of InstanceHandler as the serialization.
        Parameters:
        type - the bidder type
        populationId - the population id
        storageHandler - 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:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object