📄 lostsalevariable.java
字号:
package com.power.pipeengine.Variable;
import java.util.*;
import java.text.*;
import com.power.pipeengine.Entity.*;
import com.power.pipeengine.*;
/**
* <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
*/
/**
* LostSaleVariable represents part of the demand that may never be met.
*/
public class LostSaleVariable
extends Variable {
static ResourceBundle res = ResourceBundle.getBundle(
"com.power.pipeengine.Res",
EngineConfig.getInstance().getLocale());
private static final LostSaleVariable INSTANCE =
new LostSaleVariable();
// Private constructor supresses
// default public constructor
private LostSaleVariable() {
}
public static LostSaleVariable getInstance() {
return INSTANCE;
}
public String getVariable(Facility f, Product p, Bucket b) {
return new String("LS" +
"F" + f.getVariableCode() +
"P" + p.getVariableCode() +
"T" + b.getVariableCode());
/*String separator = "";
return new String( "LS" + f.getFacilityID() + separator +
p.getProductID() + separator +
b.getBucketID() );*/
}
public void setObjElement(String varName, Product p, Bucket b) {
int dmdPriority = p.getDemandPriority(b) + 1;
double asp = p.getASP(b.getBucketID());
if (EngineConfig.getInstance().isMaxOnTimeDelivery()) {
setObjElement(varName, 50000.0 / dmdPriority + Math.random() * 0.0000001);
}
else {
setObjElement(varName, 50000.0 / dmdPriority + Math.random() * 0.0000001);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -