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:
StringOutput:
ParserCompiles the code
Name:
Pre ModelInput:
ParserOutput:
Pre ModelGenerates a model from the compiler output
Name:
ModelInput:
Pre ModelOutput:
ModelRun the Pre Model to generate the static model
Name:
Linear modelInput:
ModelOutput:
Linear ModelTransforms the model into a linear model
Name:
Standard linear modelInput:
Linear ModelOutput:
Standard Linear ModelTransforms the linear model into a model in standard form
Name:
Tableau for simplexInput:
Standard Linear ModelOutput:
TableauTransforms 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 ModelOutput:
Real SolutionRuns a real variable solver to find the optimal solution, the variables must be real or non negative real
Name:
Simplex solver with stepsInput:
TableauOutput:
Optimal Tableau with StepsRuns the simplex algorithm to find the optimal solution and returns the tableau at each step
Name:
Binary solverInput:
Linear ModelOutput:
Binary SolutionRuns a binary variable solver to find the optimal solution, the variables must be binary
Name:
Integer binary solverInput:
Linear ModelOutput:
Integer Binary SolutionRuns a binary and integer variable solver to find the optimal solution, the variables must be binary or integer
Name:
MILP solverInput:
Linear ModelOutput:
MILP SolutionRuns a solver that allows for real, integer and binary variables to find the optimal solution.
Name:
Auto solverInput:
Linear ModelOutput:
MILP SolutionAutomatically picks the best solver to run for this model
Name:
HiGHS solverInput:
Linear ModelOutput:
MILP SolutionA high performance MILP solver, using a linear model
Name:
HiGHS solver (Cplex LP)Input:
StringOutput:
MILP SolutionA high performance MILP solver, using the Cplex LP format
Name:
To Cplex LPInput:
Linear ModelOutput:
StringConverts a linear model to the Cplex LP format
