Package jline.io

Class LDESResultIO

  • All Implemented Interfaces:

    
    public class 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 Detail

      • LDESResultIO

        LDESResultIO()
    • Method Detail

      • save

         static void save(LDESResult result, NetworkStruct sn, String filename, boolean trajectory)

        Saves an LDESResult and associated NetworkStruct to a JSON file.

        Parameters:
        result - the LDES solver result
        sn - the network structure (for station/class names)
        filename - the output file path
        trajectory - if true, include transient trajectory data (QNt, UNt, TNt, t)
      • 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