Statistics about the search progress.
Collects data about solution costs and feasibility during optimization, allowing analysis of the search trajectory.
Example
stats = ExVrp.Statistics.new()
stats = ExVrp.Statistics.collect(stats, current, candidate, best, cost_evaluator)
Enum.each(stats, fn datum -> IO.inspect(datum) end)
Summary
Functions
Collects iteration statistics.
Returns whether this Statistics object is collecting data.
Reads a Statistics object from a CSV file.
Creates a new Statistics object.
Writes this Statistics object to a CSV file.
Types
@type t() :: %ExVrp.Statistics{ clock: integer(), collect_stats: boolean(), data: [datum()], num_iterations: non_neg_integer(), runtimes: [float()] }
Functions
Collects iteration statistics.
Parameters
stats- The Statistics objectcurrent- The current solution referencecandidate- The candidate solution referencebest- The best solution referencecost_evaluator- CostEvaluator reference used to compute costs
Returns whether this Statistics object is collecting data.
Reads a Statistics object from a CSV file.
Parameters
path- File path to read fromopts- Options (:delimiterdefaults to,)
Creates a new Statistics object.
Options
:collect_stats- Whether to collect statistics. Can be turned off to avoid excessive memory use on long runs. Defaults totrue.
Writes this Statistics object to a CSV file.
Parameters
stats- The Statistics objectpath- File path to write toopts- Options (:delimiterdefaults to,)