Unverified Commit 4b521477 authored by Miroslav Kratochvil's avatar Miroslav Kratochvil
Browse files

document hit_and_run

parent ede116bb
"""
hit_and_run(N::Int, opt_model; keepevery=100, samplesize=1000, random_objective=false)
Perform basic hit and run sampling for `N` iterations on `opt_model`, where `opt_model` is a constraint based model.
Note that `opt_model` is a JuMP model that contains whatever solver will be used to find the warmup points.
Also note, `opt_model` should already be fully constrained by however you desire.
Every `keepevery` iteration is logged as a sample, where the sample size matrix has `samplesize` columns.
Warm up points are generated in a flux variability sense, unless `random_objective` is true,
in which case a randomly weighted objective is used 2*number of reactions to define the warmup points.
Note that N needs to be >> samplesize.
Sample size is the size of the samples kept in memory.
The larger samplesize is the better the approximation becomes, but the more memory the sampler requires.
hit_and_run(
N::Int,
opt_model;
keepevery = 100,
samplesize = 1000,
random_objective = false,
)
Perform a basic hit and run sampling for `N` iterations on a constrained JuMP
model in `opt_model`.
The process generates `samplesize` samples, and logs the sample state each
`keepevery` iterations.
Warm up points are generated by minimizing and maximizing reactions as in
[`flux_variability_analysis`](@ref), unless the `random_objective` is `true`,
in which case a randomly weighted objective is used for warmup.
Note that `N` needs to be greater than sample size, and should be greater than
the dimensionality of the sampled space (i.e., at least same as the number of
reactions).
# Example
```
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment