concepts.dm.crow.behavior_utils.CrowAdditiveHeuristicProgramExecutor#
- class CrowAdditiveHeuristicProgramExecutor[source]#
Bases:
object
Methods
evaluate
(expression, state[, csp, ...])Evaluate an expression and return the result.
get_cost
()run
(stmt, scope)- __init__(executor, state, minimize=None, is_unit_cost=False)[source]#
- Parameters:
executor (CrowExecutor)
state (CrowState)
minimize (ValueOutputExpression | None)
is_unit_cost (bool)
- __new__(**kwargs)#
- evaluate(expression, state, csp=None, bounded_variables=None, clone_csp=True, force_tensor_value=False)[source]#
Evaluate an expression and return the result.
- Parameters:
expression (ObjectOrValueOutputExpression | VariableAssignmentExpression) – the expression to evaluate.
state (CrowState) – the current state.
csp (ConstraintSatisfactionProblem | None) – the current CSP.
bounded_variables (Dict[str, ObjectConstant | TensorValue] | None) – the bounded variables.
clone_csp (bool) – whether to clone the CSP.
force_tensor_value (bool) – whether to force the result to be a tensor value.
- Returns:
the evaluation result and the updated CSP.
- Return type:
Tuple[None | StateObjectReference | StateObjectList | TensorValue | OptimisticValue, ConstraintSatisfactionProblem | None]