Class ObjectiveProgressReport

java.lang.Object
ca.spatial.reportwriter.Report
ca.spatial.patchworks.ObjectiveProgressReport
All Implemented Interfaces:
Selectable<Report>, Comparable<Report>

public class ObjectiveProgressReport extends Report
This report will track the progress of specific components of the objective function, and will display charts of how these terms change over the course of the simulation.

The report will create two charts. The first shows the number of iterations on the x axis and the objective function value on the y axis. Each sub-element of the objective function (as specified in the constructor) is displayed.
Objective performance chart

The second chart shows the percent change in the objective function terms over the course of the simulation.
Objective change chart

These charts can be used to confirm the progress that is being made by the solver, and help in making decisions about how many iterations should be allowed in order to achieve an acceptable convergence.

Here is an example of how to create this report type:

 reportWriter.addReport(new ObjectiveProgressReport("scenario/progress",
   "Progress of accounts towards solution",
   new String[] {"product.Yield.*", "flow.even.product.Yield.*", "ratio.Route.*", "patch.opening.*"},
  ""));
 
  • Field Details

    • TYPES

      public static final String[] TYPES
  • Constructor Details

    • ObjectiveProgressReport

      public ObjectiveProgressReport(String filename, String title, String[] patterns, String html)
      Create a new report that will track changes to the objective function that occur from the time that the report is added. The charts will show the change in objective function value over time. The objective values to display are determined by the value of the patterns parameter. This parameter contains a list of regular expression that will be matched against the targets defined in the model. The objective function value from each match target will be summed, and the results display as they change through time, and as a percent change from one point to the next.

      The objective function is sampled each time the solver prints out progress information. Over the course of a lengthy simulation the report may record a very large number of sample points.

      Here is an example of how to create this report type:

       reportWriter.addReport(new ObjectiveProgressReport("scenario/progress",
         "Progress of accounts towards solution",
         new String[] {"product.Yield.*", "flow.even.product.Yield.*", "ratio.Route.*", "patch.opening.*"},
        ""));
       
      Parameters:
      filename - The basename of the report (not including the filename extenstion).
      title - The report title (also used in the index).
      patterns - A list of regular expression, each one describing a set of targets that should be added to the report. The chart legends will have one entry for each pattern.
    • ObjectiveProgressReport

      public ObjectiveProgressReport(String filename, String title, ConvergenceSpec[] specs, String html)
  • Method Details

    • doReport

      public ca.spatial.reportwriter.Report.DataCache doReport(String filename, PrintStream out, Map<String,​Object> param, ca.spatial.reportwriter.Report.DataCache cache)
      Description copied from class: Report
      The method used by the report writer to format the requested report. This method is implemented in every custom report. Application programs generally do not need to call this method, but instead use the report writer methods to obtain reports.
      Specified by:
      doReport in class Report
      Parameters:
      filename - The full name of the report to be printed, including the extension of the sub-report (if any).
      out - The output stream to print output on to.
      param - A HashMap containing parameters that modify the report (for example the scenario name).
    • getTypes

      public String[] getTypes()
      Description copied from class: Report
      An accessor function to retrieve the list of report types supported by this report. See the documentation for the TYPES variable for the list of sub-types.
      Specified by:
      getTypes in class Report