Class: Prediction

Koviko.Prediction()

A prediction, capable of calculating and estimating ticks and rewards of an action.

Constructor

new Prediction()

Source:

Members

_ticks :number

The pre-calculated amount of ticks needed for the action to complete.
Type:
  • number
Source:

action :Koviko~Action

Action being estimated
Type:
Source:

affected :Array.<string>

Resources affected by the action
Type:
  • Array.<string>
Source:

effect :function|null

Effect of the action.
Type:
  • function | null
Source:

loop :Koviko.Prediction~Loop|null

Effect(s) and tick calculations of the action's loops
Type:
Source:

name :string

Name of the action
Type:
  • string
Source:

Methods

(static) exp(a, s)

Add the experience gained in one tick to the accumulated stat experience.
Parameters:
Name Type Description
a Koviko.Prediction~Action Action object
s Koviko.Predictor~Stats Accumulated stat experience
Source:

(static) ticks()

Get the pre-calculated amount of ticks needed for the action to complete.
Source:

(static) updateTicks(a, s)

Calculate the number of ticks needed to complete the action.
Parameters:
Name Type Description
a Koviko.Prediction~Action Action object
s Koviko.Predictor~Stats Accumulated stat experience
Source:

Type Definitions

Loop

Loop attributes for a prediction
Type:
  • Object
Properties:
Name Type Description
cost function Cost to complete a segment
tick function Amount of progress completed in one tick
effect Object Effects at the end of a loop or segment
Properties
Name Type Attributes Description
segment function <optional>
Effect at the end of a segment
loop function <optional>
Effect at the end of a loop
Source:

Parameters

Parameters to be passed to the Prediction constructor
Type:
  • Object
Properties:
Name Type Description
affected Array.<string> Affected resources
effect function Method that will mutate resources
loop Koviko.Prediction~Loop Loop attributes
Source: