1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Variable type for the modeling API
/// Integrality requirement for a decision variable.
///
/// `Continuous` is the default (matches pre-MIP behaviour). `Integer` / `Binary`
/// route the model through the MILP/MIQP branch-and-bound solver. `Binary` is an
/// `Integer` variable additionally fixed to the `[0, 1]` box.
/// A lightweight handle to a decision variable.
///
/// `Variable` is `Copy`, so it can be used in expressions multiple times
/// without being consumed: `x + y` does not move `x`.
///
/// Internally, a `Variable` carries its index and the ID of the model that
/// created it. The model ID is used by [`ModelResult::try_value`] to detect
/// cross-model variable misuse at runtime.
/// Metadata about a variable stored in the `Model`.
pub