pub enum IntegerExpression {
Show 14 variants Constant(Integer), Variable(usize), ResourceVariable(usize), Cost, UnaryOperation(UnaryOperator, Box<IntegerExpression>), BinaryOperation(BinaryOperator, Box<IntegerExpression>, Box<IntegerExpression>), Cardinality(SetExpression), Length(VectorExpression), Table(Box<NumericTableExpression<Integer>>), If(Box<Condition>, Box<IntegerExpression>, Box<IntegerExpression>), FromContinuous(CastOperator, Box<ContinuousExpression>), Last(Box<IntegerVectorExpression>), At(Box<IntegerVectorExpression>, ElementExpression), Reduce(ReduceOperator, Box<IntegerVectorExpression>),
}
Expand description

Integer numeric expression.

Variants§

§

Constant(Integer)

Constant.

§

Variable(usize)

Variable index.

§

ResourceVariable(usize)

Resource variable index.

§

Cost

The cost of the transitioned state.

§

UnaryOperation(UnaryOperator, Box<IntegerExpression>)

Unary arithmetic operation.

§

BinaryOperation(BinaryOperator, Box<IntegerExpression>, Box<IntegerExpression>)

Binary arithmetic operation.

§

Cardinality(SetExpression)

The cardinality of a set expression.

§

Length(VectorExpression)

The cardinality of a set expression.

§

Table(Box<NumericTableExpression<Integer>>)

A constant in an integer table.

§

If(Box<Condition>, Box<IntegerExpression>, Box<IntegerExpression>)

If-then-else expression, which returns the first one if the condition holds and the second one otherwise.

§

FromContinuous(CastOperator, Box<ContinuousExpression>)

Conversion from a continuous expression.

§

Last(Box<IntegerVectorExpression>)

The last value in an integer vector.

§

At(Box<IntegerVectorExpression>, ElementExpression)

An item in an integer vector.

§

Reduce(ReduceOperator, Box<IntegerVectorExpression>)

Reduce operation on an integer vector expression.

Implementations§

source§

impl IntegerExpression

source

pub fn abs(self) -> IntegerExpression

Returns an expression representing the abstract value.

Examples
use dypdl::prelude::*;

let model = Model::default();
let state = model.target.clone();
let expression = IntegerExpression::from(-1);
let expression = expression.abs();

assert_eq!(expression.eval(&state, &model.table_registry), 1);
source§

impl IntegerExpression

source

pub fn floor<T>(x: T) -> IntegerExpressionwhere ContinuousExpression: From<T>,

Returns an integer expression by taking the floor of the continuous expression.

Examples
use dypdl::prelude::*;

let model = Model::default();
let state = model.target.clone();

let expression = ContinuousExpression::from(1.5);
let expression = IntegerExpression::floor(expression);

assert_eq!(expression.eval(&state, &model.table_registry), 1);
source

pub fn ceil<T>(x: T) -> IntegerExpressionwhere ContinuousExpression: From<T>,

Returns an integer expression by taking the ceiling of the continuous expression.

Examples
use dypdl::prelude::*;

let model = Model::default();
let state = model.target.clone();

let expression = ContinuousExpression::from(1.5);
let expression = IntegerExpression::ceil(expression);

assert_eq!(expression.eval(&state, &model.table_registry), 2);
source

pub fn round<T>(x: T) -> IntegerExpressionwhere ContinuousExpression: From<T>,

Returns an integer expression by rounding the continuous expression.

Examples
use dypdl::prelude::*;

let model = Model::default();
let state = model.target.clone();

let expression = ContinuousExpression::from(1.5);
let expression = IntegerExpression::round(expression);

assert_eq!(expression.eval(&state, &model.table_registry), 2);
source

pub fn trunc<T>(x: T) -> IntegerExpressionwhere ContinuousExpression: From<T>,

Returns an integer expression by truncating the continuous expression.

Examples
use dypdl::prelude::*;

let model = Model::default();
let state = model.target.clone();

let expression = ContinuousExpression::from(1.5);
let expression = IntegerExpression::trunc(expression);

assert_eq!(expression.eval(&state, &model.table_registry), 1);
source§

impl IntegerExpression

source

pub fn eval<U: StateInterface>( &self, state: &U, registry: &TableRegistry ) -> Integer

Returns the evaluation result.

Panics

Panics if the cost of the transition state is used or a min/max reduce operation is performed on an empty set or vector.

Examples
use dypdl::prelude::*;

let mut model = Model::default();
let variable = model.add_integer_variable("variable", 1).unwrap();
let state = model.target.clone();

let expression = IntegerExpression::from(variable);
assert_eq!(expression.eval(&state, &model.table_registry), 1);
source

pub fn eval_cost<U: StateInterface>( &self, cost: Integer, state: &U, registry: &TableRegistry ) -> Integer

Returns the evaluation result of a cost expression.

Panics

Panics if a min/max reduce operation is performed on an empty set or vector.

Examples
use dypdl::prelude::*;

let model = Model::default();
let state = model.target.clone();

let expression = IntegerExpression::Cost + 1;
assert_eq!(expression.eval_cost(1, &state, &model.table_registry), 2);
source

pub fn simplify(&self, registry: &TableRegistry) -> IntegerExpression

Returns a simplified version by precomputation.

Panics

Panics if a min/max reduce operation is performed on an empty set or vector.

Trait Implementations§

source§

impl Add<ContinuousExpression> for IntegerExpression

source§

fn add(self, rhs: ContinuousExpression) -> ContinuousExpression

Returns an expression representing the addition.

§

type Output = ContinuousExpression

The resulting type after applying the + operator.
source§

impl Add<ContinuousResourceVariable> for IntegerExpression

source§

fn add(self, rhs: ContinuousResourceVariable) -> ContinuousExpression

Returns an expression representing the addition.

§

type Output = ContinuousExpression

The resulting type after applying the + operator.
source§

impl Add<ContinuousVariable> for IntegerExpression

source§

fn add(self, rhs: ContinuousVariable) -> ContinuousExpression

Returns an expression representing the addition.

§

type Output = ContinuousExpression

The resulting type after applying the + operator.
source§

impl Add<IntegerExpression> for Continuous

source§

fn add(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the addition.

§

type Output = ContinuousExpression

The resulting type after applying the + operator.
source§

impl Add<IntegerExpression> for ContinuousExpression

source§

fn add(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the addition.

§

type Output = ContinuousExpression

The resulting type after applying the + operator.
source§

impl Add<IntegerExpression> for ContinuousResourceVariable

source§

fn add(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the addition.

§

type Output = ContinuousExpression

The resulting type after applying the + operator.
source§

impl Add<IntegerExpression> for ContinuousVariable

source§

fn add(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the addition.

§

type Output = ContinuousExpression

The resulting type after applying the + operator.
source§

impl Add<IntegerExpression> for Integer

source§

fn add(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the addition.

§

type Output = IntegerExpression

The resulting type after applying the + operator.
source§

impl Add<IntegerExpression> for IntegerExpression

source§

fn add(self, rhs: Self) -> Self::Output

Returns an expression representing the addition.

Examples
use dypdl::prelude::*;

let model = Model::default();
let state = model.target.clone();
let a = IntegerExpression::from(2);
let b = IntegerExpression::from(3);
let expression = a + b;

assert_eq!(expression.eval(&state, &model.table_registry), 5);
§

type Output = IntegerExpression

The resulting type after applying the + operator.
source§

impl Add<IntegerExpression> for IntegerResourceVariable

source§

fn add(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the addition.

§

type Output = IntegerExpression

The resulting type after applying the + operator.
source§

impl Add<IntegerExpression> for IntegerVariable

source§

fn add(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the addition.

§

type Output = IntegerExpression

The resulting type after applying the + operator.
source§

impl Add<IntegerResourceVariable> for IntegerExpression

source§

fn add(self, rhs: IntegerResourceVariable) -> IntegerExpression

Returns an expression representing the addition.

§

type Output = IntegerExpression

The resulting type after applying the + operator.
source§

impl Add<IntegerVariable> for IntegerExpression

source§

fn add(self, rhs: IntegerVariable) -> IntegerExpression

Returns an expression representing the addition.

§

type Output = IntegerExpression

The resulting type after applying the + operator.
source§

impl Add<f64> for IntegerExpression

source§

fn add(self, rhs: Continuous) -> ContinuousExpression

Returns an expression representing the addition.

§

type Output = ContinuousExpression

The resulting type after applying the + operator.
source§

impl Add<i32> for IntegerExpression

source§

fn add(self, rhs: Integer) -> IntegerExpression

Returns an expression representing the addition.

§

type Output = IntegerExpression

The resulting type after applying the + operator.
source§

impl AddDualBound<IntegerExpression> for Model

source§

fn add_dual_bound(&mut self, bound: IntegerExpression) -> Result<(), ModelErr>

Adds a dual bound.

Errors

If the expression is invalid, e.g., it uses not existing variables or the state of the transitioned state.

Examples
use dypdl::prelude::*;

let mut model = Model::default();

assert!(model.add_dual_bound(IntegerExpression::from(0)).is_ok());
source§

impl AddEffect<IntegerResourceVariable, IntegerExpression> for Transition

source§

fn add_effect<V>( &mut self, v: IntegerResourceVariable, expression: V ) -> Result<(), ModelErr>where IntegerExpression: From<V>,

Adds an effect. Read more
source§

impl AddEffect<IntegerVariable, IntegerExpression> for Transition

source§

fn add_effect<V>( &mut self, v: IntegerVariable, expression: V ) -> Result<(), ModelErr>where IntegerExpression: From<V>,

Adds an effect. Read more
source§

impl CheckExpression<IntegerExpression> for Model

source§

fn check_expression( &self, expression: &IntegerExpression, allow_cost: bool ) -> Result<(), ModelErr>

Checks if an expression is valid. Read more
source§

impl Clone for IntegerExpression

source§

fn clone(&self) -> IntegerExpression

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl ContinuousBinaryOperation<ContinuousExpression> for IntegerExpression

§

type Output = ContinuousExpression

source§

fn pow(self, rhs: ContinuousExpression) -> ContinuousExpression

Returns an expression representing the power.
source§

fn log(self, rhs: ContinuousExpression) -> ContinuousExpression

Returns an expression representing the logarithm.
source§

impl ContinuousBinaryOperation<ContinuousResourceVariable> for IntegerExpression

§

type Output = ContinuousExpression

source§

fn pow(self, rhs: ContinuousResourceVariable) -> ContinuousExpression

Returns an expression representing the power.
source§

fn log(self, rhs: ContinuousResourceVariable) -> ContinuousExpression

Returns an expression representing the logarithm.
source§

impl ContinuousBinaryOperation<ContinuousVariable> for IntegerExpression

§

type Output = ContinuousExpression

source§

fn pow(self, rhs: ContinuousVariable) -> ContinuousExpression

Returns an expression representing the power.
source§

fn log(self, rhs: ContinuousVariable) -> ContinuousExpression

Returns an expression representing the logarithm.
source§

impl ContinuousBinaryOperation<IntegerExpression> for Continuous

§

type Output = ContinuousExpression

source§

fn pow(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the power.
source§

fn log(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the logarithm.
source§

impl ContinuousBinaryOperation<IntegerExpression> for ContinuousExpression

§

type Output = ContinuousExpression

source§

fn pow(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the power.
source§

fn log(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the logarithm.
source§

impl ContinuousBinaryOperation<IntegerExpression> for ContinuousResourceVariable

§

type Output = ContinuousExpression

source§

fn pow(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the power.
source§

fn log(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the logarithm.
source§

impl ContinuousBinaryOperation<IntegerExpression> for ContinuousVariable

§

type Output = ContinuousExpression

source§

fn pow(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the power.
source§

fn log(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the logarithm.
source§

impl ContinuousBinaryOperation<f64> for IntegerExpression

§

type Output = ContinuousExpression

source§

fn pow(self, rhs: Continuous) -> ContinuousExpression

Returns an expression representing the power.
source§

fn log(self, rhs: Continuous) -> ContinuousExpression

Returns an expression representing the logarithm.
source§

impl Debug for IntegerExpression

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for IntegerExpression

source§

fn default() -> Self

Returns an expression representing a constant zero.

source§

impl Div<ContinuousExpression> for IntegerExpression

source§

fn div(self, rhs: ContinuousExpression) -> ContinuousExpression

Returns an expression representing the division.

§

type Output = ContinuousExpression

The resulting type after applying the / operator.
source§

impl Div<ContinuousResourceVariable> for IntegerExpression

source§

fn div(self, rhs: ContinuousResourceVariable) -> ContinuousExpression

Returns an expression representing the division.

§

type Output = ContinuousExpression

The resulting type after applying the / operator.
source§

impl Div<ContinuousVariable> for IntegerExpression

source§

fn div(self, rhs: ContinuousVariable) -> ContinuousExpression

Returns an expression representing the division.

§

type Output = ContinuousExpression

The resulting type after applying the / operator.
source§

impl Div<IntegerExpression> for Continuous

source§

fn div(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the division.

§

type Output = ContinuousExpression

The resulting type after applying the / operator.
source§

impl Div<IntegerExpression> for ContinuousExpression

source§

fn div(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the division.

§

type Output = ContinuousExpression

The resulting type after applying the / operator.
source§

impl Div<IntegerExpression> for ContinuousResourceVariable

source§

fn div(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the division.

§

type Output = ContinuousExpression

The resulting type after applying the / operator.
source§

impl Div<IntegerExpression> for ContinuousVariable

source§

fn div(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the division.

§

type Output = ContinuousExpression

The resulting type after applying the / operator.
source§

impl Div<IntegerExpression> for Integer

source§

fn div(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the division.

§

type Output = IntegerExpression

The resulting type after applying the / operator.
source§

impl Div<IntegerExpression> for IntegerExpression

source§

fn div(self, rhs: Self) -> Self::Output

Returns an expression representing the division.

Examples
use dypdl::prelude::*;

let model = Model::default();
let state = model.target.clone();
let a = IntegerExpression::from(2);
let b = IntegerExpression::from(3);
let expression = a / b;

assert_eq!(expression.eval(&state, &model.table_registry), 0);
§

type Output = IntegerExpression

The resulting type after applying the / operator.
source§

impl Div<IntegerExpression> for IntegerResourceVariable

source§

fn div(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the division.

§

type Output = IntegerExpression

The resulting type after applying the / operator.
source§

impl Div<IntegerExpression> for IntegerVariable

source§

fn div(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the division.

§

type Output = IntegerExpression

The resulting type after applying the / operator.
source§

impl Div<IntegerResourceVariable> for IntegerExpression

source§

fn div(self, rhs: IntegerResourceVariable) -> IntegerExpression

Returns an expression representing the division.

§

type Output = IntegerExpression

The resulting type after applying the / operator.
source§

impl Div<IntegerVariable> for IntegerExpression

source§

fn div(self, rhs: IntegerVariable) -> IntegerExpression

Returns an expression representing the division.

§

type Output = IntegerExpression

The resulting type after applying the / operator.
source§

impl Div<f64> for IntegerExpression

source§

fn div(self, rhs: Continuous) -> ContinuousExpression

Returns an expression representing the division.

§

type Output = ContinuousExpression

The resulting type after applying the / operator.
source§

impl Div<i32> for IntegerExpression

source§

fn div(self, rhs: Integer) -> IntegerExpression

Returns an expression representing the division.

§

type Output = IntegerExpression

The resulting type after applying the / operator.
source§

impl From<IntegerExpression> for ContinuousExpression

source§

fn from(v: IntegerExpression) -> Self

Converts to this type from the input type.
source§

impl From<IntegerExpression> for CostExpression

source§

fn from(cost: IntegerExpression) -> Self

Converts to this type from the input type.
source§

impl From<IntegerResourceVariable> for IntegerExpression

source§

fn from(v: IntegerResourceVariable) -> Self

Returns an expression representing the resource variable.

source§

impl From<IntegerVariable> for IntegerExpression

source§

fn from(v: IntegerVariable) -> Self

Returns an expression representing the variable.

source§

impl From<i32> for IntegerExpression

source§

fn from(v: Integer) -> Self

Returns an expression representing the constant.

source§

impl IfThenElse<IntegerExpression> for Condition

source§

fn if_then_else<U, V>(self, lhs: U, rhs: V) -> IntegerExpressionwhere IntegerExpression: From<U> + From<V>,

Returns an if-then-else expression, which returns a if this condition holds and b otherwise.
source§

impl MaxMin<ContinuousExpression> for IntegerExpression

§

type Output = ContinuousExpression

source§

fn max(self, rhs: ContinuousExpression) -> ContinuousExpression

Returns an expression representing the maximum.
source§

fn min(self, rhs: ContinuousExpression) -> ContinuousExpression

Returns an expression representing the minimum.
source§

impl MaxMin<ContinuousResourceVariable> for IntegerExpression

§

type Output = ContinuousExpression

source§

fn max(self, rhs: ContinuousResourceVariable) -> ContinuousExpression

Returns an expression representing the maximum.
source§

fn min(self, rhs: ContinuousResourceVariable) -> ContinuousExpression

Returns an expression representing the minimum.
source§

impl MaxMin<ContinuousVariable> for IntegerExpression

§

type Output = ContinuousExpression

source§

fn max(self, rhs: ContinuousVariable) -> ContinuousExpression

Returns an expression representing the maximum.
source§

fn min(self, rhs: ContinuousVariable) -> ContinuousExpression

Returns an expression representing the minimum.
source§

impl MaxMin<IntegerExpression> for Continuous

§

type Output = ContinuousExpression

source§

fn max(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the maximum.
source§

fn min(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the minimum.
source§

impl MaxMin<IntegerExpression> for ContinuousExpression

§

type Output = ContinuousExpression

source§

fn max(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the maximum.
source§

fn min(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the minimum.
source§

impl MaxMin<IntegerExpression> for ContinuousResourceVariable

§

type Output = ContinuousExpression

source§

fn max(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the maximum.
source§

fn min(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the minimum.
source§

impl MaxMin<IntegerExpression> for ContinuousVariable

§

type Output = ContinuousExpression

source§

fn max(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the maximum.
source§

fn min(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the minimum.
source§

impl MaxMin<IntegerExpression> for Integer

§

type Output = IntegerExpression

source§

fn max(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the maximum.
source§

fn min(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the minimum.
source§

impl MaxMin<IntegerExpression> for IntegerExpression

source§

fn max(self, rhs: Self) -> Self::Output

Returns an expression representing the maximum.

Examples
use dypdl::prelude::*;

let model = Model::default();
let state = model.target.clone();
let a = IntegerExpression::from(2);
let b = IntegerExpression::from(3);
let expression = a.max(b);

assert_eq!(expression.eval(&state, &model.table_registry), 3);
source§

fn min(self, rhs: Self) -> Self::Output

Returns an expression representing the minimum.

Examples
use dypdl::prelude::*;

let model = Model::default();
let state = model.target.clone();
let a = IntegerExpression::from(2);
let b = IntegerExpression::from(3);
let expression = a.min(b);

assert_eq!(expression.eval(&state, &model.table_registry), 2);
§

type Output = IntegerExpression

source§

impl MaxMin<IntegerExpression> for IntegerResourceVariable

§

type Output = IntegerExpression

source§

fn max(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the maximum.
source§

fn min(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the minimum.
source§

impl MaxMin<IntegerExpression> for IntegerVariable

§

type Output = IntegerExpression

source§

fn max(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the maximum.
source§

fn min(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the minimum.
source§

impl MaxMin<IntegerResourceVariable> for IntegerExpression

§

type Output = IntegerExpression

source§

fn max(self, rhs: IntegerResourceVariable) -> IntegerExpression

Returns an expression representing the maximum.
source§

fn min(self, rhs: IntegerResourceVariable) -> IntegerExpression

Returns an expression representing the minimum.
source§

impl MaxMin<IntegerVariable> for IntegerExpression

§

type Output = IntegerExpression

source§

fn max(self, rhs: IntegerVariable) -> IntegerExpression

Returns an expression representing the maximum.
source§

fn min(self, rhs: IntegerVariable) -> IntegerExpression

Returns an expression representing the minimum.
source§

impl MaxMin<f64> for IntegerExpression

§

type Output = ContinuousExpression

source§

fn max(self, rhs: Continuous) -> ContinuousExpression

Returns an expression representing the maximum.
source§

fn min(self, rhs: Continuous) -> ContinuousExpression

Returns an expression representing the minimum.
source§

impl MaxMin<i32> for IntegerExpression

§

type Output = IntegerExpression

source§

fn max(self, rhs: Integer) -> IntegerExpression

Returns an expression representing the maximum.
source§

fn min(self, rhs: Integer) -> IntegerExpression

Returns an expression representing the minimum.
source§

impl Mul<ContinuousExpression> for IntegerExpression

source§

fn mul(self, rhs: ContinuousExpression) -> ContinuousExpression

Returns an expression representing the multiplication.

§

type Output = ContinuousExpression

The resulting type after applying the * operator.
source§

impl Mul<ContinuousResourceVariable> for IntegerExpression

source§

fn mul(self, rhs: ContinuousResourceVariable) -> ContinuousExpression

Returns an expression representing the multiplication.

§

type Output = ContinuousExpression

The resulting type after applying the * operator.
source§

impl Mul<ContinuousVariable> for IntegerExpression

source§

fn mul(self, rhs: ContinuousVariable) -> ContinuousExpression

Returns an expression representing the multiplication.

§

type Output = ContinuousExpression

The resulting type after applying the * operator.
source§

impl Mul<IntegerExpression> for Continuous

source§

fn mul(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the multiplication.

§

type Output = ContinuousExpression

The resulting type after applying the * operator.
source§

impl Mul<IntegerExpression> for ContinuousExpression

source§

fn mul(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the multiplication.

§

type Output = ContinuousExpression

The resulting type after applying the * operator.
source§

impl Mul<IntegerExpression> for ContinuousResourceVariable

source§

fn mul(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the multiplication.

§

type Output = ContinuousExpression

The resulting type after applying the * operator.
source§

impl Mul<IntegerExpression> for ContinuousVariable

source§

fn mul(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the multiplication.

§

type Output = ContinuousExpression

The resulting type after applying the * operator.
source§

impl Mul<IntegerExpression> for Integer

source§

fn mul(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the multiplication.

§

type Output = IntegerExpression

The resulting type after applying the * operator.
source§

impl Mul<IntegerExpression> for IntegerExpression

source§

fn mul(self, rhs: Self) -> Self::Output

Returns an expression representing the multiplication.

Examples
use dypdl::prelude::*;

let model = Model::default();
let state = model.target.clone();
let a = IntegerExpression::from(2);
let b = IntegerExpression::from(3);
let expression = a * b;

assert_eq!(expression.eval(&state, &model.table_registry), 6);
§

type Output = IntegerExpression

The resulting type after applying the * operator.
source§

impl Mul<IntegerExpression> for IntegerResourceVariable

source§

fn mul(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the multiplication.

§

type Output = IntegerExpression

The resulting type after applying the * operator.
source§

impl Mul<IntegerExpression> for IntegerVariable

source§

fn mul(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the multiplication.

§

type Output = IntegerExpression

The resulting type after applying the * operator.
source§

impl Mul<IntegerResourceVariable> for IntegerExpression

source§

fn mul(self, rhs: IntegerResourceVariable) -> IntegerExpression

Returns an expression representing the multiplication.

§

type Output = IntegerExpression

The resulting type after applying the * operator.
source§

impl Mul<IntegerVariable> for IntegerExpression

source§

fn mul(self, rhs: IntegerVariable) -> IntegerExpression

Returns an expression representing the multiplication.

§

type Output = IntegerExpression

The resulting type after applying the * operator.
source§

impl Mul<f64> for IntegerExpression

source§

fn mul(self, rhs: Continuous) -> ContinuousExpression

Returns an expression representing the multiplication.

§

type Output = ContinuousExpression

The resulting type after applying the * operator.
source§

impl Mul<i32> for IntegerExpression

source§

fn mul(self, rhs: Integer) -> IntegerExpression

Returns an expression representing the multiplication.

§

type Output = IntegerExpression

The resulting type after applying the * operator.
source§

impl Neg for IntegerExpression

source§

fn neg(self) -> Self::Output

Returns an expression representing the negative value.

Examples
use dypdl::prelude::*;

let model = Model::default();
let state = model.target.clone();
let expression = IntegerExpression::from(1);
let expression = -expression;

assert_eq!(expression.eval(&state, &model.table_registry), -1);
§

type Output = IntegerExpression

The resulting type after applying the - operator.
source§

impl PartialEq<IntegerExpression> for IntegerExpression

source§

fn eq(&self, other: &IntegerExpression) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Rem<ContinuousExpression> for IntegerExpression

source§

fn rem(self, rhs: ContinuousExpression) -> ContinuousExpression

Returns an expression representing the remainder.

§

type Output = ContinuousExpression

The resulting type after applying the % operator.
source§

impl Rem<ContinuousResourceVariable> for IntegerExpression

source§

fn rem(self, rhs: ContinuousResourceVariable) -> ContinuousExpression

Returns an expression representing the remainder.

§

type Output = ContinuousExpression

The resulting type after applying the % operator.
source§

impl Rem<ContinuousVariable> for IntegerExpression

source§

fn rem(self, rhs: ContinuousVariable) -> ContinuousExpression

Returns an expression representing the remainder.

§

type Output = ContinuousExpression

The resulting type after applying the % operator.
source§

impl Rem<IntegerExpression> for Continuous

source§

fn rem(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the remainder.

§

type Output = ContinuousExpression

The resulting type after applying the % operator.
source§

impl Rem<IntegerExpression> for ContinuousExpression

source§

fn rem(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the remainder.

§

type Output = ContinuousExpression

The resulting type after applying the % operator.
source§

impl Rem<IntegerExpression> for ContinuousResourceVariable

source§

fn rem(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the remainder.

§

type Output = ContinuousExpression

The resulting type after applying the % operator.
source§

impl Rem<IntegerExpression> for ContinuousVariable

source§

fn rem(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the remainder.

§

type Output = ContinuousExpression

The resulting type after applying the % operator.
source§

impl Rem<IntegerExpression> for Integer

source§

fn rem(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the remainder.

§

type Output = IntegerExpression

The resulting type after applying the % operator.
source§

impl Rem<IntegerExpression> for IntegerExpression

source§

fn rem(self, rhs: Self) -> Self::Output

Returns an expression representing the remainder.

Examples
use dypdl::prelude::*;

let model = Model::default();
let state = model.target.clone();
let a = IntegerExpression::from(2);
let b = IntegerExpression::from(3);
let expression = a % b;

assert_eq!(expression.eval(&state, &model.table_registry), 2);
§

type Output = IntegerExpression

The resulting type after applying the % operator.
source§

impl Rem<IntegerExpression> for IntegerResourceVariable

source§

fn rem(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the remainder.

§

type Output = IntegerExpression

The resulting type after applying the % operator.
source§

impl Rem<IntegerExpression> for IntegerVariable

source§

fn rem(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the remainder.

§

type Output = IntegerExpression

The resulting type after applying the % operator.
source§

impl Rem<IntegerResourceVariable> for IntegerExpression

source§

fn rem(self, rhs: IntegerResourceVariable) -> IntegerExpression

Returns an expression representing the remainder.

§

type Output = IntegerExpression

The resulting type after applying the % operator.
source§

impl Rem<IntegerVariable> for IntegerExpression

source§

fn rem(self, rhs: IntegerVariable) -> IntegerExpression

Returns an expression representing the remainder.

§

type Output = IntegerExpression

The resulting type after applying the % operator.
source§

impl Rem<f64> for IntegerExpression

source§

fn rem(self, rhs: Continuous) -> ContinuousExpression

Returns an expression representing the remainder.

§

type Output = ContinuousExpression

The resulting type after applying the % operator.
source§

impl Rem<i32> for IntegerExpression

source§

fn rem(self, rhs: Integer) -> IntegerExpression

Returns an expression representing the remainder.

§

type Output = IntegerExpression

The resulting type after applying the % operator.
source§

impl Sub<ContinuousExpression> for IntegerExpression

source§

fn sub(self, rhs: ContinuousExpression) -> ContinuousExpression

Returns an expression representing the subtraction.

§

type Output = ContinuousExpression

The resulting type after applying the - operator.
source§

impl Sub<ContinuousResourceVariable> for IntegerExpression

source§

fn sub(self, rhs: ContinuousResourceVariable) -> ContinuousExpression

Returns an expression representing the subtraction.

§

type Output = ContinuousExpression

The resulting type after applying the - operator.
source§

impl Sub<ContinuousVariable> for IntegerExpression

source§

fn sub(self, rhs: ContinuousVariable) -> ContinuousExpression

Returns an expression representing the subtraction.

§

type Output = ContinuousExpression

The resulting type after applying the - operator.
source§

impl Sub<IntegerExpression> for Continuous

source§

fn sub(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the subtraction.

§

type Output = ContinuousExpression

The resulting type after applying the - operator.
source§

impl Sub<IntegerExpression> for ContinuousExpression

source§

fn sub(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the subtraction.

§

type Output = ContinuousExpression

The resulting type after applying the - operator.
source§

impl Sub<IntegerExpression> for ContinuousResourceVariable

source§

fn sub(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the subtraction.

§

type Output = ContinuousExpression

The resulting type after applying the - operator.
source§

impl Sub<IntegerExpression> for ContinuousVariable

source§

fn sub(self, rhs: IntegerExpression) -> ContinuousExpression

Returns an expression representing the subtraction.

§

type Output = ContinuousExpression

The resulting type after applying the - operator.
source§

impl Sub<IntegerExpression> for Integer

source§

fn sub(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the subtraction.

§

type Output = IntegerExpression

The resulting type after applying the - operator.
source§

impl Sub<IntegerExpression> for IntegerExpression

source§

fn sub(self, rhs: Self) -> Self::Output

Returns an expression representing the subtraction.

Examples
use dypdl::prelude::*;

let model = Model::default();
let state = model.target.clone();
let a = IntegerExpression::from(2);
let b = IntegerExpression::from(3);
let expression = a - b;

assert_eq!(expression.eval(&state, &model.table_registry), -1);
§

type Output = IntegerExpression

The resulting type after applying the - operator.
source§

impl Sub<IntegerExpression> for IntegerResourceVariable

source§

fn sub(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the subtraction.

§

type Output = IntegerExpression

The resulting type after applying the - operator.
source§

impl Sub<IntegerExpression> for IntegerVariable

source§

fn sub(self, rhs: IntegerExpression) -> IntegerExpression

Returns an expression representing the subtraction.

§

type Output = IntegerExpression

The resulting type after applying the - operator.
source§

impl Sub<IntegerResourceVariable> for IntegerExpression

source§

fn sub(self, rhs: IntegerResourceVariable) -> IntegerExpression

Returns an expression representing the subtraction.

§

type Output = IntegerExpression

The resulting type after applying the - operator.
source§

impl Sub<IntegerVariable> for IntegerExpression

source§

fn sub(self, rhs: IntegerVariable) -> IntegerExpression

Returns an expression representing the subtraction.

§

type Output = IntegerExpression

The resulting type after applying the - operator.
source§

impl Sub<f64> for IntegerExpression

source§

fn sub(self, rhs: Continuous) -> ContinuousExpression

Returns an expression representing the subtraction.

§

type Output = ContinuousExpression

The resulting type after applying the - operator.
source§

impl Sub<i32> for IntegerExpression

source§

fn sub(self, rhs: Integer) -> IntegerExpression

Returns an expression representing the subtraction.

§

type Output = IntegerExpression

The resulting type after applying the - operator.
source§

impl StructuralPartialEq for IntegerExpression

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for Twhere T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,