Rooc runtime
Inside Rooc, you can use the functions defined inside of the runtime to perform operations on the data. There are 3 kinds of functions:
- Normal functions: They accept an input and return an output
- Block functions: They have a block where you can write an expression, and the block function will do some operation over the block
- Block scoped functions: Like block functions, but they have an iteration scope. Inside of the scope you can define how to iterate over the data, and it will be available in the block for you to use.
Functions
They are functions that accept parameters and return a value, you can use them inside blocks,
assignments or in expressions
Returns the length of the iterable
Enumerates the iterable, returning a tuple of the element and its index
Enumerates the iterable, returning a tuple of the element and its index
Returns the edges of a graph
Returns the edges of a graph
Returns the nodes of a graph
Returns the nodes of a graph
Returns the neighbour edges of a node
Returns the neighbour edges of a node
Returns the neighbour edges of a node name in a graph
Returns the neighbour edges of a node name in a graph
Returns an iterable of integers from `from` to `to` (inclusive or exclusive)
Zips two or more iterables together, returning a tuple of the elements, the length of the resulting iterable is the length of the shortest iterable
Returns the difference of two iterables
Returns the union of two iterables
Returns the intersection of two iterablesBlock functions
They are blocks which have one or more expressions separated by a comma, they will use those
expressions to perform a transformation, like the avg (average) block
Computes the inner expression as the minimum of all elements
Computes the inner expression as the maximum of all elements
Computes the inner expression as the average of all elementsBlock scoped functions
They are function blocks, it has as parameters one or more iterators over iterable data, they
will declare a variable (or more using tuples destructuring) for each iterator and then execute
the block.
If there are more than one iterators, they will behave as nested iterators, where the first iterator is the outermost one
If there are more than one iterators, they will behave as nested iterators, where the first iterator is the outermost one
Expands the inner expression into a sum of all elements
Expands the inner expression into a product of all elements
Expands the inner expression into the minimum of all elements
Expands the inner expression into the maximum of all elements
Expands the inner expression into the average of all elementsExecution pipes
Other than the model, you can define an execution pipeline that you can customise to do what you need.
There are some presets you can choose from, but in general, each pipe step has an input and produces an output, each step of the pipeline will be executed one after the other in the order they are defined, and each result will be shown as the output.
There are some presets you can choose from, but in general, each pipe step has an input and produces an output, each step of the pipeline will be executed one after the other in the order they are defined, and each result will be shown as the output.
Name:
CompilerInput:
String
Output:
Parser
Compiles the code
Name:
Pre ModelInput:
Parser
Output:
Pre Model
Generates a model from the compiler output
Name:
ModelInput:
Pre Model
Output:
Model
Run the Pre Model to generate the static model
Name:
Linear modelInput:
Model
Output:
Linear Model
Transforms the model into a linear model
Name:
Standard linear modelInput:
Linear Model
Output:
Standard Linear Model
Transforms the linear model into a model in standard form
Name:
Tableau for simplexInput:
Standard Linear Model
Output:
Tableau
Transforms the standard linear model into a tableau that can be used in the simplex algorithm, it creates artificial variables to find the initial basis
Name:
Real solverInput:
Linear Model
Output:
Real Solution
Runs a real variable solver to find the optimal solution, the variables must be real or non negative real
Name:
Simplex solver with stepsInput:
Tableau
Output:
Optimal Tableau with Steps
Runs the simplex algorithm to find the optimal solution and returns the tableau at each step
Name:
Binary solverInput:
Linear Model
Output:
Binary Solution
Runs a binary variable solver to find the optimal solution, the variables must be binary
Name:
Integer binary solverInput:
Linear Model
Output:
Integer Binary Solution
Runs a binary and integer variable solver to find the optimal solution, the variables must be binary or integer
Name:
MILP solverInput:
Linear Model
Output:
MILP Solution
Runs a solver that allows for real, integer and binary variables to find the optimal solution.
Name:
Auto solverInput:
Linear Model
Output:
MILP Solution
Automatically picks the best solver to run for this model