APS(高级排产系统)

源代码在线查看: startsvariable.java

软件大小: 4105 K
上传用户: sunqingyan
关键词: APS
下载地址: 免注册下载 普通下载 VIP

相关代码

				package com.power.pipeengine.Variable;
				
				import com.power.pipeengine.Entity.*;
				import com.power.pipeengine.*;
				import java.util.ResourceBundle;
				
				public class StartsVariable
				    extends Variable {
				  private static final StartsVariable INSTANCE =
				      new StartsVariable();
				
				  // Private constructor supresses
				  // default public constructor
				  private StartsVariable() {
				  }
				
				  public static StartsVariable getInstance() {
				    return INSTANCE;
				  }
				
				  public String getVariable(Route r, Product p, Bucket b) {
				    String varName = new String("S" +
				                                "R" + r.getVariableCode() +
				                                "P" + p.getVariableCode() +
				                                "T" + b.getVariableCode());
				    /*String separator = "";
				       String varName =  new String( "S" +
				           r.getRouteID() + separator +
				           p.getProductID() + separator +
				           b.getBucketID() );*/
				    setObjElement(varName, r, b);
				    return varName;
				  }
				
				  public void setObjElement(String varName, Route r, Bucket b) {
				    //start as early as possible, or JIT
				    double cost = r.getCostPerStart();
				    //if (cost < 0.6) {
				      cost = 1;
				    //}
				    double coeff = 1;
				    for (int i = 0; i < b.getBucketID(); i++) {
				      coeff *= 10;
				    }
				    setObjElement(varName,
				                   cost - (100 - b.getBucketID())/100 /*+ Math.random() * 0.0000001 - 0.000001 * b.getBucketID()*/);
				
				  }
				}			

相关资源