Package jline.io
Class LDESResultIO
java.lang.Object
jline.io.LDESResultIO
Provides 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 -
Method Summary
Modifier and TypeMethodDescriptionstatic LDESResultLoads anLDESResultfrom a JSON file.loadClassNames(String filename) Returns class names from a result JSON file, or null if unavailable.loadStationNames(String filename) Returns station names from a result JSON file, or null if unavailable.static voidsave(LDESResult result, NetworkStruct sn, String filename) Saves anLDESResultand associatedNetworkStructto a JSON file.static voidsave(LDESResult result, NetworkStruct sn, String filename, boolean trajectory) Saves anLDESResultand associatedNetworkStructto a JSON file.
-
Constructor Details
-
LDESResultIO
public LDESResultIO()
-
-
Method Details
-
save
Saves anLDESResultand associatedNetworkStructto a JSON file.- Parameters:
result- the LDES solver resultsn- the network structure (for station/class names)filename- the output file path- Throws:
IOException- if the file cannot be written
-
save
public static void save(LDESResult result, NetworkStruct sn, String filename, boolean trajectory) throws IOException Saves anLDESResultand associatedNetworkStructto a JSON file.- Parameters:
result- the LDES solver resultsn- the network structure (for station/class names)filename- the output file pathtrajectory- if true, include transient trajectory data (QNt, UNt, TNt, t)- Throws:
IOException- if the file cannot be written
-
load
Loads anLDESResultfrom a JSON file.- Parameters:
filename- the input file path- Returns:
- the deserialized LDESResult
- Throws:
IOException- if the file cannot be read or the format is invalid
-
loadStationNames
Returns station names from a result JSON file, or null if unavailable.- Parameters:
filename- the result JSON file path- Returns:
- list of station names
- Throws:
IOException- if the file cannot be read
-
loadClassNames
Returns class names from a result JSON file, or null if unavailable.- Parameters:
filename- the result JSON file path- Returns:
- list of class names
- Throws:
IOException- if the file cannot be read
-