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(): string | undefined

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

string | undefined

Set Signature

set name(value: string): void

Parameters
ParameterType
valuestring
Returns

void

Inherited from

ModelElement.name

Constructors

Constructor

new FloatExpr(): FloatExpr

Returns

FloatExpr

Inherited from

ModelElement.constructor