PsiObj(objective cell, sense, valueof, chancetype, chance measure, comment, model name, critical)

PsiObj adds an objective cell to the optimization model.

objective cell – The cell address of the objective cell.

sense – The optimization sense: "min" (minimization), "max" (maximization), or "ValueOf" (using the ValueOf property).

valueof – If sense is set to "ValueOf," pass the numerical target value here (e.g., 1000). Otherwise, this argument is not used.

chance type – An integer value indicating the type of objective: 0 (Normal), 1 (Expected), 2 (VaR), 3 (CVaR), or 4 (USet).

chance measure – A value from 0 to 1, required if the objective includes uncertainty. This argument specifies the confidence level used when evaluating the objective under the selected chance type. For example, setting chance type to VaR or CVaR with a chance measure of 0.95 evaluates the objective at the 95th percentile / confidence level. When chance type is USet (uncertainty set), this argument instead represents the set size, controlling the size of the uncertainty set used in the robust optimization formulation. This argument has no effect when chance type is 0 (Normal) or 1 (Expected).

comment – An optional comment, in quotes, which appears under "Comment" in the Variable Property Window. (To view the Property Window, highlight the variable or range of variables in the Task Pane Model tab; the Property Window appears at the bottom of the task pane.)

model name – A model or sheet name, in quotes, indicating to ASP what model or worksheet the objective belongs to.

critical – Set to True to display the objective in bold, making it stand out visually — useful for quickly locating relevant objectives when navigating a long list. Additionally, variables, constraints, or an objective designated as critical will be preselected when deploying a model in TEAMS (Deploy Model – Teams).