ANTAREX API

Clava API

LARA API

LARA Common Language API

MargotBlock

Constructor

MargotBlock

new MargotBlock(name)

This holds information about a mARGOt configuration block.

Parameters

name: string - the name of the this block

Instance Members

addDataFeature

addDataFeature(name, type, [validity = MargotValidity.NONE])

Adds a new feature to the feature group of this block.

If it wasn't defined before, a new group will be created with a default distance type value of MargotDistanceType.EUCLIDEAN.

Parameters

name: string - the name of the variable that holds the value of the data feature
type: string - the type of the variable that holds the value of the data feature
validity: MargotValidity - the comparison used to test the validity (optional)

addKnob

addKnob(name, varName, varType)

Adds a knob to the block with the given data.

Parameters

name: string - the name of the knob
varName: string - the name of the variable that holds the knob value
varType: string - the type of the variable that holds the knob value

addKnobGoal

addKnobGoal(name, cFun, value, knob)

Adds a knob goal to the block with the given data.

Parameters

name: string - the name of the goal
cFun: MargotCFun - the comparison function
value: Number - the numeric value of the goal
knob: string - the name of the knob

addMetric

addMetric(name, type, distribution)

Adds a metric to the block with the given data.

Parameters

name: string - the name of the metric
type: string - the type of the metric
distribution: boolean - whether this metric is a distribution

addMetricGoal

addMetricGoal(name, cFun, value, metric)

Adds a metric goal to the block with the given data.

Parameters

name: string - the name of the goal
cFun: MargotCFun - the comparison function
value: Number - the numeric value of the goal
metric: string - the name of the metric

addMonitor

addMonitor(monitor)

Adds a monitor to this block.

Parameters

monitor: MargotMonitor - the monitor to add

addRuntimeProvider

addRuntimeProvider(metricName, monitorName, inertia)

Adds a runtime information provider to the block with the given data.

Parameters

metricName: string - the name of the metric
monitorName: string - the name of the monitor
inertia: number - the inertia of the adaptation

addState

addState(state)

Adds a state to the list of states.

Parameters

state: MargotState - the state to add

newEnergyMonitor

newEnergyMonitor(name)

Builds an energy monitor, adds it to the list of monitors, and returns it.

Parameters

name: string - the name of the monitor

Returns

MargotEnergyMonitor - the created energy monitor

newState

newState(name)

Builds a state, adds it to the list of states, and returns it.

Parameters

name: string - the name of the state to create

Returns

MargotState - the created state

newThroughputMonitor

newThroughputMonitor(name, param1, param2)

Builds throughput monitor, adds it to the list of monitors, and returns it.

Parameters

name: string - the name of the monitor
param1: any
param2: any

Returns

MargotThroughputMonitor - the created throughput monitor

newTimeMonitor

newTimeMonitor(name)

Builds a time monitor, adds it to the list of monitors, and returns it.

Parameters

name: string - the name of the monitor

Returns

MargotTimeMonitor - the created time monitor

setDataFeatureDistanceType

setDataFeatureDistanceType(distanceType)

Sets the distance type of the feature group of this block.

Parameters

distanceType: MargotDistanceType - the type of distance calculation for data features