import Stat from 'Artistoo/src/stats/Stat.js'
public class | source

Stat

Base class for a statistic that can be computed on a GridBasedModel. This class by itself is not usable; see its subclasses for stats that are currently supported.

Constructor Summary

Public Constructor
public

The constructor of class Stat takes a 'conf' object as argument.

Member Summary

Public Members
public

The model to compute the stat on.

public

Configuration object for the stat, which should not change its value but may be used for logging and debugging options.

public set

Every stat is linked to a specific model.

Method Summary

Public Methods
public abstract

The compute method of the base Stat class throws an error, enforcing that you have to implement this method when you build a new stat class extending this base class.

Public Constructors

public constructor(conf: object) source

The constructor of class Stat takes a 'conf' object as argument. However, Stats should not really be configurable in the sense that they should always provide an expected output. The 'conf' object is mainly intended to provide an option to configure logging / debugging output. That is not implemented yet.

Params:

NameTypeAttributeDescription
conf object

configuration options for the Stat, which should change nothing about the return value produced by the compute() method but may be used for logging and debugging options.

Public Members

public M: GridBasedModel source

The model to compute the stat on.

public conf: object source

Configuration object for the stat, which should not change its value but may be used for logging and debugging options.

public set model(M: GridBasedModel) source

Every stat is linked to a specific model.

Public Methods

public abstract compute() source

The compute method of the base Stat class throws an error, enforcing that you have to implement this method when you build a new stat class extending this base class.