This is a (mostly) comprehensive listing of the built-in functions and literals in Epox, the Lisp-like language used in the SFGP representation of EpochX. However, custom functions, literals and variables can be declared to expand this language.
Language Functions
The built-in language functions are all found in the org.epochx.epox.lang package.
Identifier | Node Class | Description |
---|---|---|
IF | IfFunction | Conditional if-else statement |
SEQ2 | Seq2Function | Chains two nodes together in sequence |
SEQ3 | Seq3Function | Chains three nodes together in sequence |
SEQN | SeqNFunction | Chains N nodes together in sequence. N is supplied as an argument to the constructor. |
Boolean Functions
The built-in boolean functions are all found in the org.epochx.epox.bool package.
Identifier | Node Class | Description |
---|---|---|
AND | AndFunction | Performs logical conjunction |
IFF | IfAndOnlyIfFunction | Performs logical if-and-only-if |
IMPLIES | ImpliesFunction | Performs logical implication |
NAND | NandFunction | Performs NAND, negation of logical conjunction |
NOR | NorFunction | Performs NOR, negation of logical OR |
NOT | NotFunction | Performs logical negation |
OR | OrFunction | Performs logical disjunction |
XOR | XorFunction | Performs exclusive disjunction |
Mathematical Functions
The built-in math functions are all found in the org.epochx.epox.math package.
Identifier | Node Class | Description |
---|---|---|
ABS | AbsoluteFunction | Returns the positive version of a numerical value |
ADD | AddFunction | Sums two numerical values |
CVP | CoefficientPowerFunction | Represents a variable with exponent and coefficient. Equivalent to a PowerFunction combined with a MultiplyFunction. |
CUBE | CubeFunction | Raises its input to the third power. Equivalent to the PowerFunction with an input of 3.0. |
CBRT | CubeRootFunction | Returns cube root of the input |
PDIV | DivisionProtectedFunction | Performs division, where division by zero is protected (using a value specified at construction). |
EXP | ExponentialFunction | Performs exponential function, e^x where e is Euler's constant |
FACTORIAL | FactorialFunction | Performs factorial, FACTORIAL(3) == 3 * 2 * 1 |
GT | GreaterThanFunction | Performs greater-than comparison, returns boolean |
INV | InvertProtectedFunction | Performs reciprocal, where reciprical of zero is protected (using a value specified at construction). |
LT | LessThanFunction | Performs less-than comparison, returns boolean |
LOG-10 | Log10Function | Performs the common (base 10) logarithm |
LN | LogFunction | Performs the natural (base e) logarithm |
MAX | Max2Function | Compares two numeric inputs and returns the largest |
MAX3 | Max3Function | Compares three numeric inputs and returns the largest |
MIN | Min2Function | Compares two numeric inputs and returns the largest |
MIN3 | Min3Function | Compares three numeric inputs and returns the largest |
MOD | ModuloProtectedFunction | Performs modulo, where modulo of zero is protected (returns the dividend). |
MUL | MultiplyFunction | Performs multiplication |
POW | PowerFunction | Performs exponentiation |
SGN | SignumFunction | Performs the sign function that extracts the sign of a number |
SQUARE | SquareFunction | Raises its input to the second power. Equivalent to the PowerFunction with an input of 2.0. |
SQRT | SquareRootFunction | Returns the square root of the input |
SUB | SubtractFunction | Performs numeric subtraction |
Trigonometric Functions
The built-in trigonometric functions are all found in the org.epochx.epox.trig package.
Identifier | Node Class | Description |
---|---|---|
ARCCSC | ArcCosecantFunction | Performs arc-cosecant |
ARCCOS | ArcCosineFunction | Performs arc-cosine |
ARCCOT | ArcCotangentFunction | Performs arc-cotangent |
ARCSEC | ArcSecantFunction | Performs arc-secant |
ARCSIN | ArcSineFunction | Performs arc-sine |
ARCTAN | ArcTangentFunction | Performs arc-tangent |
ARCOSH | AreaHyperbolicCosineFunction | Performs area hyperbolic cosine |
ARSINH | AreaHyperbolicSineFunction | Performs area hyperbolic sine |
ARTANH | AreaHyperbolicTangentFunction | Performs area hyperbolic tangent |
CSC | CosecantFunction | Performs cosecant |
COS | CosineFunction | Performs cosine |
COT | CotangentFunction | Performs cotangent |
COSH | HyperbolicCosineFunction | Performs hyperbolic cosine |
SINH | HyperbolicSineFunction | Performs hyperbolic sine |
TANH | HyperbolicTangentFunction | Performs hyperbolic tangent |
SEC | SecantFunction | Performs secant |
SIN | SineFunction | Performs sine |
TAN | TangentFunction | Performs tangent |
Ant Functions
The built-in ant functions are all found in the org.epochx.epox.ant package.
Identifier | Node Class | Description |
---|---|---|
MOVE | AntMoveFunction | Moves an ant instance forward one space in its landscape |
SKIP | AntSkipFunction | Causes an ant instance to move on one time-step with changing position in its landscape |
TURN-LEFT | AntTurnLeftFunction | Causes an ant instance to turn left from its current orientation in its landscape |
TURN-RIGHT | AntTurnRightFunction | Causes an ant instance to turn right from its current orientation in its landscape |
IF-FOOD-AHEAD | IfFoodAheadFunction | Conditionally evaluates a statement depending on the presence of food in the position in front of an ant |
Literals
Literal values are taken from Java's primitive and object data-types:
Data-type | Details |
---|---|
Boolean | true/false |
Integer | |
Double | |
Character | |
String |