constraint.java

来自「著名IT公司ILog的APS高级排产优化引擎」· Java 代码 · 共 55 行

JAVA
55
字号
package com.power.pipeengine.Constraint;

import com.power.util.Message.*;
import com.power.pipeengine.*;
import java.util.ResourceBundle;
import com.power.lpsolver.LPSolve.*;
/**
 *
 * <p>Title: PIPE Engine</p>
 * <p>Description: Global Planning Optimization Engine</p>
 * <p>Copyright: Copyright (c) 2002</p>
 * <p>Company: Paraster, Inc.</p>
 * @author Wei Tan
 * @version 1.0
 */

/**
 * Constraint is the super class of all constraint types.
 */
public class Constraint
{
    static ResourceBundle res = ResourceBundle.getBundle("com.power.pipeengine.Res",
                                                          EngineConfig.getInstance().getLocale() );
    private String _constraintType = "";

    /**
     * Sole class constructor.
     */
    public Constraint() {
    }

    /**
     * Sets the constraint type to the type specified in paraster.
     * @param aType the type to set for this constraint.
     */
    protected void setConstraintType( String aType ) {
      _constraintType = aType;
    }

    /**
     * Publishes message right before building the constraints.
     */
    public void publishMessage() {
        String msg = res.getString("Engine1200") + _constraintType + ".\n";
        MessageArea.getInstance().addMessage( msg );
    }

    public void addMPSElem(com.power.lpsolver.LPSolve.Constraint con, int colIdx, Element elem) {
        com.power.lpsolver.LPSolve.Variable var =
                Model.getInstance().getModelVariables().getVariable( colIdx );
        var.addMPSElem( con, elem );
    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?