Skip to main content

Class: FloatExpr

Remarks

A class representing floating-point expression in the model. Currently, there is no way to create floating-point expressions. The class is only a base class for IntExpr.

Extends

Extended by

Accessors

name

Get Signature

get name(): undefined | string

The name assigned to this model element.

Remarks

The name is optional and primarily useful for debugging purposes. When set, it helps identify the element in solver logs, error messages, and when inspecting solutions.

Names can be assigned to any model element including variables, expressions, and constraints.

Example
import * as CP from "optalcp";

const model = new CP.Model();

// Name a variable at creation
const task = model.intervalVar({ length: 10, name: "assembly" });

// Or set name later
const x = model.intVar({ min: 0, max: 100 });
x.name = "quantity";

console.log(task.name); // "assembly"
console.log(x.name); // "quantity"
Returns

undefined | string

Set Signature

set name(value: string): void

Parameters
ParameterType
valuestring
Returns

void

Inherited from

ModelElement.name

Constructors

new FloatExpr()

new FloatExpr(): FloatExpr

Returns

FloatExpr

Inherited from

ModelElement.constructor

Properties

PropertyModifierType
__floatExprBrandreadonly"FloatExpr"