Struct conjure_oxide::Model
source · pub struct Model {
pub variables: HashMap<Name, DecisionVariable>,
pub constraints: Expression,
pub context: Arc<RwLock<Context<'static>>>,
/* private fields */
}
Fields§
§variables: HashMap<Name, DecisionVariable>
§constraints: Expression
§context: Arc<RwLock<Context<'static>>>
Implementations§
source§impl Model
impl Model
pub fn new( variables: HashMap<Name, DecisionVariable>, constraints: Expression, context: Arc<RwLock<Context<'static>>>, ) -> Model
pub fn new_empty(context: Arc<RwLock<Context<'static>>>) -> Model
pub fn update_domain(&mut self, name: &Name, new_domain: Domain)
pub fn get_domain(&self, name: &Name) -> Option<&Domain>
pub fn add_variable(&mut self, name: Name, decision_var: DecisionVariable)
pub fn get_constraints_vec(&self) -> Vec<Expression>
pub fn set_constraints(&mut self, constraints: Vec<Expression>)
pub fn set_context(&mut self, context: Arc<RwLock<Context<'static>>>)
pub fn add_constraint(&mut self, expression: Expression)
pub fn add_constraints(&mut self, expressions: Vec<Expression>)
Trait Implementations§
source§impl<'de> Deserialize<'de> for Model
impl<'de> Deserialize<'de> for Model
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Model, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Model, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Serialize for Model
impl Serialize for Model
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for Model
Auto Trait Implementations§
impl !Freeze for Model
impl !RefUnwindSafe for Model
impl Send for Model
impl !Sync for Model
impl Unpin for Model
impl UnwindSafe for Model
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)