Advisor

The Advisor runtime component proposes how to optimize the current operation based on previous experiences. It keeps an up-to-date database of previous experiences, and use this to propose the best strategy to optimize the current operation. It is based on three categories of data:

  • User choices
  • Operational demands
  • Operational consequences, typically oil consumption.

The current version is quite hard coded. It uses the CommonVesselInfo topic of CommonVesselInfo type as input and the topic AdvisorOptimum of CommonVesselInfo type for giving advise. Based on the input, it calculates

  • User choices: Modus, which tells the combination of main clutch, PTI and PTO as a number between 1 and 7.
  • Operational demands: Normalized thrust, electric consumption (except for PTI) and speed.
  • Operational consequences: For each combination of choices and demands, the system stores for each field of CommonVesselInfo topic:
    • Average value
    • Variance
    • Number of samples

The best choice is found as the one that gives the lowest normalized fuel consumption. Its function is otherwise governed by the input file, where the various options are as follows:

  • Options:
    • PeriodMs:[1000] The period of running an iteration of the component, specified in ms.
    • HsFile: [dss.nc] The path to the NetCDF file used for storage and lookup in signals statistics.
    • UpdateAdvicePeriod: [10] How often the generated advise is to be sent on DDS, specified in seconds.
    • SaveOperatingPointPeriod: [10] How often the current operating point is to be stored, given the operation is deemed stable, specified in seconds.
    • SaveToFilePeriod: [60] How often the statistics is to be stored to file, specified in seconds.
  • VesselSpec:
    • GearRatio: [3.83] The ratio between measured main engine rpm and propeller rpm when clutch is in.
    • ThrustFactor: [1.4] A factor on thrust used only to make different vessels comparable.
    • RelGearTol: [0.05] The tolerance used when detecting if clutch is in. The expression is:
      bool clutchIn = abs(meRpm / max(propRpm,1.0)/gearRatio - 1) < relGearTol
    • PtiTol: [5] The threshold for detecting that PTI is active.
    • PtoTol: [5] The threshold for detecting that PTO is active.
  • InputFilter: The input signals are filtered and their stability is a requirement for adding data to the statistics. Stability is deemed when a for given number of samples, all samples have been close to the average value over a given period.
    • ToleranceScale: [0.1] The accepted tolerance as a ratio of the approximate valid interval of each measurement.
    • StableSamplesCriteria: [20] The number of stable samples which are required to deem the current operation stable.
    • FilterSamples: [60] The number of samples to use for the running average of the signals.
  • OptimumSearch:
    • MinNumSamples: [3] The minimum number of samples in the statistics file for a operational point to be valid.

An example yaml input file is shown under, and can also be found here: advisor.yml.

Options:
PeriodMs: 100
HsFile: dss.nc
UpdateAdvicePeriod: 10
SaveOperatingPointPeriod: 60
SaveToFilePeriod: 600
VesselSpec:
GearRatio: 3.83
ThrustFactor: 1.4
RelGearTol: 0.05
PtiTol: 5
PtoTol: 5
InputFilter:
ToleranceScale: 0.05
StableSamplesCriteria: 20
WindowSize: 60
OptimumSearch:
MinNumSamples: 3