Package jline.io
Class LDESResultIO
-
- All Implemented Interfaces:
public class LDESResultIOProvides save/load functionality for LDES solver results to/from JSON format.
Serializes LDESResult (and base SolverResult) fields to a JSON file that can be parsed by the Python wrapper or other tools without needing JVM access.
Usage:
// Save result LDESResultIO.save(result, sn, "result.json"); // Load result LDESResult result = LDESResultIO.load("result.json");
-
-
Constructor Summary
Constructors Constructor Description LDESResultIO()
-
Method Summary
Modifier and Type Method Description static voidsave(LDESResult result, NetworkStruct sn, String filename)Saves an LDESResult and associated NetworkStruct to a JSON file. static LDESResultload(String filename)Loads an LDESResult from a JSON file. static List<String>loadStationNames(String filename)Returns station names from a result JSON file, or null if unavailable. static List<String>loadClassNames(String filename)Returns class names from a result JSON file, or null if unavailable. -
-
Method Detail
-
save
static void save(LDESResult result, NetworkStruct sn, String filename)
Saves an LDESResult and associated NetworkStruct to a JSON file.
- Parameters:
result- the LDES solver resultsn- the network structure (for station/class names)filename- the output file path
-
load
static LDESResult load(String filename)
Loads an LDESResult from a JSON file.
- Parameters:
filename- the input file path- Returns:
the deserialized LDESResult
-
loadStationNames
static List<String> loadStationNames(String filename)
Returns station names from a result JSON file, or null if unavailable.
- Parameters:
filename- the result JSON file path- Returns:
list of station names
-
loadClassNames
static List<String> loadClassNames(String filename)
Returns class names from a result JSON file, or null if unavailable.
- Parameters:
filename- the result JSON file path- Returns:
list of class names
-
-
-
-