Skip to contents

Building a model

model()
Create an empty model
num_var() int_var() bin_var() add_var()
Declare decision variables
set_start()
Start the next search from a known solution
minimize() maximize()
Set the objective
add()
Add constraints to a model
expressions
Expressions: arithmetic on variables
sum() prod() max() min()
Sums, products, maxima and minima
holds()
A comparison as a 0/1 expression

Uncertain data

stochastic
Optimization under uncertainty
rand_var() add_rand_var()
Declare a random variable
set_distribution()
Give a random variable its distribution
set_scenarios()
Set how many scenarios are drawn, and from which seed
set_empirical()
Use observed data as a model's uncertainty
distribution() normal() uniform() exponential() bernoulli()
Distributions for random variables
empirical()
A random variable given by a sample
expectation()
The average over the scenarios
cvar()
The average over the worst scenarios
prob()
The probability that a comparison holds
variance() std_dev()
The variance and the standard deviation over the scenarios
scenario_max() scenario_min() scenario_quantile()
The largest, the smallest and a quantile over the scenarios
is_random()
Does an expression vary across scenarios?

Orderings, groups and lookups

perm_var() add_perm_var()
Declare an ordering as a decision
item_at() slot_of()
The item in a slot, and the slot of an item
precede()
Require one item to come before another
part_var() add_part_var()
Divide items into groups as a decision
part_of() size_of()
The part of an item, and the size of a part
lookup_table() `[`(<quicopt_table>)
A table of data indexed by decisions

Minimum loads, fees and blocks

active()
Whether a variable is in use
block()
Group the variables of a subproblem

Solving and checking a solution

solve_model() solve(<quicopt_model>)
Solve a model
submit()
Solve a model without waiting
job_status() job_result() job_log() job_delete()
Follow up a submitted job
evaluate()
Compute a quantity at a given solution
resample()
Check a solution on new scenarios
DEFAULT_BASE_URL
The address of the public Quicopt service

Building a program by hand

program()
A model as plain data
CONTINUOUS INTEGER BINARY SEMICONTINUOUS SEMIINTEGER var_decl()
A decision variable, for building a program by hand
index_set()
An index set, for building a program by hand
constraint()
A constraint, for building a program by hand
zero() nonneg() indicator()
Constraint sets, for building a program by hand
parametric()
A random variable with a distribution, for building a program by hand
permutation_decl()
A permutation, for building a program by hand
partition_decl()
A partition, for building a program by hand
ir_const() ir_param() ir_var() ir_apply() ir_reduce() ir_source_ref() ir_struct_ref() ir_table_ref() ir_set_ref()
Expression nodes, for building a program by hand
wire
The bytes sent to the service
encode()
Encode a model as the bytes the service reads
encode_params()
Encode parameter tables on their own
as_program()
Convert a model to a program