java.lang.Object
simpa.core.api.SHCombiner
Singleton pattern class that combines the SHField with a map of scalings and
can serialize and deserialize the SHField to a file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetEvaluator
(Map<String, Double> scalings) Gets an implementation of PotentialProvider using the given scalings.getEvaluatorWithoutCaching
(Map<String, Double> scalings) Gets an instance of PotentialProvider using the given scalings.getFieldMapWithoutCaching
(Map<String, Double> scalings) Gets an instance of PotentialProvider using the given scalings.static SHCombiner
Returns the instance of the SHCombiner and creates it if it doesn't exist yet.void
serializeToFile
(String serialObjectFilename, Map<String, Double> scalings) Serializes the SHField to a file.
-
Constructor Details
-
SHCombiner
public SHCombiner()
-
-
Method Details
-
getUniqueInstance
Returns the instance of the SHCombiner and creates it if it doesn't exist yet.- Returns:
- SHCombiner object.
-
serializeToFile
public void serializeToFile(String serialObjectFilename, Map<String, Double> scalings) throws IOExceptionSerializes the SHField to a file.- Parameters:
serialObjectFilename
- Name of the output file.scalings
- Map that contains a scaling factor for the fieldmap with the given name.- Throws:
IOException
- When an IO error happens.
-
getEvaluator
Gets an implementation of PotentialProvider using the given scalings. Using this method all field map will be kept in memory and an evaluator can be obtained quickly. THE DISADVANTAGE IS THAT THE MEMORY CONSUMPTION IS HIGH! If you don't have a lot of memory or the consecutive re-scaling of field maps is not necessary, then use the @see getEvaluatorWithoutCaching method.- Parameters:
scalings
- Map that contains a scaling factor for the field map with the given name.- Returns:
- an implementation of PotentialProvider for evaluating the field.
- Throws:
IOException
- When an IO error happens.
-
getEvaluatorWithoutCaching
Gets an instance of PotentialProvider using the given scalings. The field maps will be added as they are read and will not kept in memory, only the currently read one and the sum. This leads to less memory requirement than the @see getEvaluator method.- Parameters:
scalings
- Map that contains a scaling factor for the fieldmap with the given name.- Returns:
- an implementation of PotentialProvider for evaluating the field.
- Throws:
IOException
- When an IO error happens.
-
getFieldMapWithoutCaching
Gets an instance of PotentialProvider using the given scalings. The field maps will be added as they are read and will not kept in memory, only the currently read one and the sum. This leads to less memory requirement than the @see getEvaluator method.- Parameters:
scalings
- Map that contains a scaling factor for the fieldmap with the given name.- Returns:
- A FieldMap instance.
- Throws:
IOException
- When an IO error happens.
-