biogeme.expressions.comparison_expressions module

Arithmetic expressions accepted by Biogeme: comparison operators

author:

Michel Bierlaire

date:

Sat Sep 9 15:20:12 2023Tue Mar 26 16:47:49 2019

class biogeme.expressions.comparison_expressions.ComparisonOperator(left, right)[source]

Bases: BinaryOperator

Base class for comparison expressions.

Parameters:
  • left (ExpressionOrNumeric)

  • right (ExpressionOrNumeric)

audit(database=None)[source]

Performs various checks on the expression.

Return type:

tuple[list[str], list[str]]

Parameters:

database (Database)

class biogeme.expressions.comparison_expressions.Equal(left, right)[source]

Bases: ComparisonOperator

Logical equal

Parameters:
  • left (ExpressionOrNumeric)

  • right (ExpressionOrNumeric)

getValue()[source]

Warning

This function is deprecated. Use get_value() instead.

Kept for backward compatibility

Return type:

float

get_value()[source]

Evaluates the value of the expression

Returns:

value of the expression

Return type:

float

class biogeme.expressions.comparison_expressions.Greater(left, right)[source]

Bases: ComparisonOperator

Logical greater

Parameters:
  • left (ExpressionOrNumeric)

  • right (ExpressionOrNumeric)

getValue()[source]

Warning

This function is deprecated. Use get_value() instead.

Kept for backward compatibility

Return type:

float

get_value()[source]

Evaluates the value of the expression

Returns:

value of the expression

Return type:

float

class biogeme.expressions.comparison_expressions.GreaterOrEqual(left, right)[source]

Bases: ComparisonOperator

Logical greater or equal

Parameters:
  • left (ExpressionOrNumeric)

  • right (ExpressionOrNumeric)

getValue()[source]

Warning

This function is deprecated. Use get_value() instead.

Kept for backward compatibility

Return type:

float

get_value()[source]

Evaluates the value of the expression

Returns:

value of the expression

Return type:

float

class biogeme.expressions.comparison_expressions.Less(left, right)[source]

Bases: ComparisonOperator

Logical less

Parameters:
  • left (ExpressionOrNumeric)

  • right (ExpressionOrNumeric)

getValue()[source]

Warning

This function is deprecated. Use get_value() instead.

Kept for backward compatibility

Return type:

float

get_value()[source]

Evaluates the value of the expression

Returns:

value of the expression

Return type:

float

class biogeme.expressions.comparison_expressions.LessOrEqual(left, right)[source]

Bases: ComparisonOperator

Logical less or equal

Parameters:
  • left (ExpressionOrNumeric)

  • right (ExpressionOrNumeric)

getValue()[source]

Warning

This function is deprecated. Use get_value() instead.

Kept for backward compatibility

Return type:

float

get_value()[source]

Evaluates the value of the expression

Returns:

value of the expression

Return type:

float

class biogeme.expressions.comparison_expressions.NotEqual(left, right)[source]

Bases: ComparisonOperator

Logical not equal

Parameters:
  • left (ExpressionOrNumeric)

  • right (ExpressionOrNumeric)

getValue()[source]

Warning

This function is deprecated. Use get_value() instead.

Kept for backward compatibility

Return type:

float

get_value()[source]

Evaluates the value of the expression

Returns:

value of the expression

Return type:

float