Class MRVMWorld

    • Method Detail

      • getBands

        public java.util.Set<MRVMBand> getBands()
      • refreshFieldBackReferences

        public void refreshFieldBackReferences()
        Description copied from class: World
        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.
        Specified by:
        refreshFieldBackReferences in class World
        See Also:
        World.refreshFieldBackReferences()
      • getLicensesPerBand

        public static java.util.Map<MRVMBand,​java.util.Set<MRVMLicense>> getLicensesPerBand​(java.util.Set<MRVMLicense> bundle)
        Sorts the licenses of a bundle into subbundles by their band. The returned map contains all bands of the world as keys, even such which are not present with any licenses in the bundle.
        Parameters:
        bundle - Must be nonempty
      • getLicensesPerBand

        public static java.util.Map<MRVMBand,​java.util.Set<MRVMLicense>> getLicensesPerBand​(java.util.Set<MRVMLicense> bundle,
                                                                                                  MRVMWorld world)
        Sorts the licenses of a bundle into subbundles by their band. The returned map contains all bands of the world as keys, even such which are not present with any licenses in the bundle.
      • quantitiesPerBand

        public static java.util.Map<MRVMBand,​java.lang.Integer> quantitiesPerBand​(java.util.Set<MRVMLicense> bundle)
        Counts the number of licenses for each band. The returned map contains all bands of the world as keys, even such which are not present with any licenses in the bundle.
        Parameters:
        bundle - Must be nonempty
      • quantitiesPerBand

        public static java.util.Map<MRVMBand,​java.lang.Integer> quantitiesPerBand​(java.util.Set<MRVMLicense> bundle,
                                                                                        MRVMWorld MRVMWorld)
        Counts the number of licenses for each band. The returned map contains all bands of the world as keys, even such which are not present with any licenses in the bundle.
        Parameters:
        bundle - Must be nonempty
      • c

        public static java.math.BigDecimal c​(MRVMRegionsMap.Region r,
                                             java.util.Set<MRVMLicense> bundle)
        Defines the c-function, i.e., c(r,x) = sum_{b\in B} cap(b,r,x) [as explained in the paper]
      • getMaximumRegionalCapacity

        public java.math.BigDecimal getMaximumRegionalCapacity()
        Calculates the maximum capacity any region can have. The result is cached, hence, calling the method multiple time is not costly.
      • capOfBand

        public static java.math.BigDecimal capOfBand​(MRVMBand band,
                                                     int numberOfLicenses)
        Returns the capacity for having numberOfLicenses many MRVMLicense in MRVMBand band
      • getLicensesPerRegion

        public static java.util.Map<MRVMRegionsMap.Region,​java.util.Set<MRVMLicense>> getLicensesPerRegion​(java.util.Set<MRVMLicense> bundle)
        Sorts the licenses of a bundle into subbundles by their region.
        Returns:
        map that contains all regions of the world as keys, even such which are not present with any licenses in the bundle.