Time-aware cells are the fundamental building blocks of the built-in time in the spreadsheet. Time-aware cell is a cell that references its own prior state in order to calculate its new value based on its previous values.
When a cell wants to reference its prior values, it needs to have the default formula specified, which is calculated at the first step of the simulation. Therefore in all subsequent steps it can safely reference its prior value, since it is already calculated. To define a simple time-aware cell representing a counter initialised to 1 and incremented by 1 in each next step, we can do te following:
= 1 => A1[-1] + 1There are three types of cells in Timeline - stateful, stateless and constant cells. This type defines how a cell is treated in terms of its calculation and storage of previous values.
Stateful cells are cells that require their full history being stored during the course of the simulation. They are typically time-aware cells that reference their own prior state or that utilise functions returning non-consistent results, such as RAND, RANDBETWEEN or NORM. An example of a stateful cell might be:
= 1 => A1[-1] + 1Another example is a non-time-aware cell holding a random value in each time step:
= RANDBETWEEN(2, 5)Stateless cells are cells that are not dependent on prior states and can be recalculated in each time step independently. These cells do not require storing their previous state as they are freshly calculated in each requested time step. An example of a stateless cell might be:
= B3 + B5 * 2This cell holds a consistent expression in terms of its dependencies and returns the same result for the same values of B3 and B5.
Constant cells are a special type of stateless cells that are calculated only once during the runtime of the simulation. These typiccally hold a constant expression that doesn't change, no matter the state of other cells. An example of a constant cell might be:
= 5 * 2 + 3This cell holds the value 13 during the course of the simulation, therefore needs to be calculated only in the first step of the simulation.
= 0 => 1In case the constant cell contains both the default and the primary formula, it is calculated twice and holds both the result of the default formula and the result of the primary formula.