Previous  Next          Contents  Index  Navigation  Glossary  Library

Optimization Expressions

Those constraints for which the autoselection / autoexclusion constraint type is selected must have an optimization expression (unless you selected the Standard Items and Quantities autoselection / autoexclusion type). The optimization expression returns a value which is used in the evaluation of the items and/or quantities of items. These items and quantities are then automatically added to the configuration or excluded from the Configurator window.

Optimization expressions can be numeric or character expressions and return a single value. They can also indicate a user-returned value based on a user-defined database stored procedure. The expression value for this autoselection / autoexclusion type is validated against the stored database procedure and checked for a single return value. See: PL/SQL Script: Sample Package Specifications or PL/SQL Script: Sample Package Body

Numeric Expressions

Numeric expressions cannot contain alphanumeric values. Standard multiplication, division, addition, subtraction, and the truncation function are supported. Standard precedence of operation is enforced; multiplication and division are performed first, then addition and subtraction. Evaluation can be controlled by using parentheses to group expressions.

Numeric expressions can reference individual numeric functions within a constraint clause. Refer to the Syntax for Referencing Clause Functions section.

Character Expressions

Character expressions are used in range based and optimized items and quantities constraint types. Literal values must be enclosed in single quotes. Concatenation is supported.

Character expressions can use both numeric or character clause name references. All literal values and clause name references must be concatenated and are validated as follows:

Syntax for Referencing Clauses

A constraint clause has a first ("left") function and a second ("right") function. The left and right sides are separated by the operator.

The optimization expression can parse the left, the right, or both sides of the constraint clause. For example:

SUM(memory ordered) < SUM(memory required)

where memory ordered is the left function and memory required is the right function. The less than operator separates the left function from the right.

The syntax for referencing individual functions of the constraint clause in the optimization expression is:

[clause_name,x]

where clause_name is the name of the clause and x is an uppercase 'L' or an uppercase 'R' to indicate the left or right side of the clause. This entire reference must be enclosed by brackets.

The clause name (referenced in the Constraints window) defaults to:

constraint_name:clause_sequence

where constraint_name is the name of the constraint, and clause_sequence is a sequence number (10, 20, 30, and so on) that defaults when the clause is written. The first clause written is 10, the second is 20. The third clause written is 30, even if it is inserted between the first and second. The default clause name and clause sequence can be overridden by the user with a user defined clause name.

When the clause name is defaulted, a colon separates the clause name from the sequence number for the purposes of referencing in an optimization expression. For example, the default name for the second clause of the MEM constraint is:

MEM:20

In the optimization expression, a comma (,) separates the clause name from the left or right side designator. The following example references the left side of the second clause of the MEM constraint:

[MEM:20,L]

Example

A complete optimization expression using the MEM constraint and two constraint clauses, lines 10 and 20, might look like:

2+[MEM:20,L]*[MEM:10,R]

This optimization expression multiplies the left function of the second clause (MEM:20,L) by the right function of the first clause (MEM:10,R) and adds 2 to the result.


         Previous  Next          Contents  Index  Navigation  Glossary  Library