The Atom Array
Solver variables are represented within Amazolve via a two dimensional (2D) atom array. The atom array is termed a "resource, time, state" array, or RTS array with each row of the array being a "resource", each column is a unit of time, and each individual cell an "atom". Atoms can be set to a "state" - the atom is the cell, the state is the value the atom is set to.
Note: While the atom array is 2D, Amazolve does offer a way to refer to the array using a third, "bit" dimension (see the X() expression functions).
Generally speaking, throughout Amazolve, a capital letter refers to the count and a lower case letter reverse to a single element. So, "R" would be the count of resources (or rows) while "r" would refer to a single row index. "T" and "t" similarly refer to the count of time columns or a single column, respectively.
"S" and "s" refer to the count of states and an individual state as well, however there is special significance to identifying whether the states being represented allow for a zero state meaning no state. In some problems there is no empty state and in others there is which can be handled differently in the contraints.
Note that the terms for these dimensions do not always refer to actual resources or points in time, but often times (particularly in scheduling problems) they do. For example, a traveling salesman problem (TSP), which is a very common multivariable problem easily solved with Amazolve, is represented as a single row (the individual salesperson) and time columns represent the order of the locations visited, and each atom state must be unique and represent the location to be visited:
Another example would be an asset allocation or portfolio optimization problem. In this case, atoms represent quantities of a given asset of an overall portfolio. The atom array would be a single column with each row representing the asset. The state would then take on some quantity (e.g., 0 to 100 states) that when normalized defines the percentage of that asset that is part of the portfolio:
Finally, a typical employee scheduling application would have multiple rows where each row is an employee, each column is a day, and each atom state contains a shift that is assigned to that employee on that day. Note that this is a case where a zero state represents a day off, or no shift assigned: