java.lang.Object
es.urjc.etsii.grafo.io.serializers.SolutionSerializer<S,I>
es.urjc.etsii.grafo.io.serializers.json.DefaultJSONSolutionSerializer<S,I>
- Type Parameters:
S
- type of the problem solutionI
- type of the problem instance
public class DefaultJSONSolutionSerializer<S extends Solution<S,I>,I extends Instance>
extends SolutionSerializer<S,I>
This class converts solution objects into their JSON equivalent by mapping the solution object variable names and value to JSON properties
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a DefaultJSONSolutionSerializer object given the properties indicated in -
Method Summary
Modifier and TypeMethodDescriptionvoid
export
(BufferedWriter writer, WorkUnitResult<S, I> result) Custom export implementation.void
Custom export implementation.Methods inherited from class es.urjc.etsii.grafo.io.serializers.SolutionSerializer
exportSolution, getConfig, getFilename, isEnabled, toString
-
Constructor Details
-
DefaultJSONSolutionSerializer
Construct a DefaultJSONSolutionSerializer object given the properties indicated in- Parameters:
config
- configuration of the JSON Serializer
-
-
Method Details
-
export
Custom export implementation. Exports the given solution to disk. You do not need to handle IOExceptions. If an IOException occurs, the given solution export is skipped.JSON export method. Exports the given solution to the provided file in JSON format.
-
export
Custom export implementation. Exports the given solution to the provided file.JSON export method. Exports the given solution to the provided file in JSON format.
- Overrides:
export
in classSolutionSerializer<S extends Solution<S,
I>, I extends Instance> - Parameters:
folder
- Folder where solutions should be stored according to the configurationsuggestedFilename
- Suggested filename, can be ignored by the implementationresult
- result to export, contains solution and extra data
-