Class Print

java.lang.Object
jline.examples.parity.Print

public final class Print extends Object
The printing contract a parity twin keeps, the Java counterpart of cpp/examples/examples_common.h.

WHAT A TWIN PRINTS IS READ BY A PARSER, not by a person. parity-static scrapes a row's stdout with the shared comparator (parity-static/_compare_vendor.py), so a banner, a bare scalar and a table header are part of the result and not decoration: a twin that computes the right number and prints it in a shape the parser does not recognise compares no cell and reports as green while asserting nothing.

WHERE THE JAR HAS NO SOLVER the twin says so BY NAME through na(String, String) and moves on. A refusal is information; answering a SolverJMT block with the MVA number is a silent solver substitution, which is the defect the harness's ported-solver list exists to prevent.

  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    The AvgTable header, the eight columns getAvgTable carries.
    static void
    avgRow(String station, String jobClass, double qlen, double util, double respt, double residt, double arvr, double tput)
    One AvgTable row, at the column widths avgHeader() declares.
    static void
    bare(double value)
    The scalar ON A LINE OF ITS OWN, beside the labelled one.
    static String
    g(double v, int sig)
    C's %.<sig>g: sig significant digits with the trailing zeros stripped, which Java's own %g does not do.
    static void
    kv(String key, double value)
    One labelled scalar, the shape a reference script prints a system metric in.
    static void
    kv(String key, String value)
     
    static void
    na(String solver, String why)
    The solver this twin does not carry, refused by name.
    static void
    note(String text)
    A line of prose, printed as the reference prints it.
    static void
    section(String title)
    The banner a reference script prints before each solver block.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • section

      public static void section(String title)
      The banner a reference script prints before each solver block.
    • note

      public static void note(String text)
      A line of prose, printed as the reference prints it.
    • na

      public static void na(String solver, String why)
      The solver this twin does not carry, refused by name.

      why names what the reference example asked for, so a reader can tell a missing engine from a model the JAR cannot express. The harness reads the SOLVER:/N/A: pair and EXCUSES that solver's golden table rather than reporting it missing.

    • kv

      public static void kv(String key, double value)
      One labelled scalar, the shape a reference script prints a system metric in.
    • kv

      public static void kv(String key, String value)
    • bare

      public static void bare(double value)
      The scalar ON A LINE OF ITS OWN, beside the labelled one.

      A reference script with no table to print puts its result bare -- print(pr_ctmc) in the Python twin -- and parse_optimization_scalar scrapes exactly that: the FIRST bare float in (0, 100). A labelled key: value line is neither a table nor a bare scalar and is read by nothing, so without this the twin computes the right number and the row still compares no cell. Call it once per example, for the quantity the reference prints bare.

      Printed at 17 significant digits, the round-trip width of a double: the golden holds the reference's full precision (0.0003484356916108198) and the six-digit kv(java.lang.String, double) form would compare a rounded number.

    • g

      public static String g(double v, int sig)
      C's %.<sig>g: sig significant digits with the trailing zeros stripped, which Java's own %g does not do.

      It matters beyond looks. The avg-table columns below are parsed as floats, and the reference tables this twin is compared against are printed by C and by Python, both of which strip; a column of 0.340000 against a golden of 0.34 parses identically but a DIFF of the two transcripts does not, and that diff is how a twin is checked by hand.

    • avgHeader

      public static void avgHeader()
      The AvgTable header, the eight columns getAvgTable carries.
    • avgRow

      public static void avgRow(String station, String jobClass, double qlen, double util, double respt, double residt, double arvr, double tput)
      One AvgTable row, at the column widths avgHeader() declares.