package com.power.pipeengine.DispatchReport;
/**
* <p>Title: PIPE Engine</p>
* <p>Description: Global Planning Optimization Engine</p>
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company: Paraster, Inc.</p>
* @author unascribed
* @version 1.0
*/
import java.util.*;
import java.io.*;
import com.power.pipeengine.Report.*;
import com.power.pipeengine.Entity.*;
import com.power.util.Message.*;
import com.power.util.urltools.*;
import com.power.pipeengine.DispatchReportMap.*;
import com.power.pipeengine.InputData.*;
import com.power.pipe.*;
import java.text.*;
public class DispatchList {
private static final DispatchList INSTANCE =
new DispatchList();
// Private constructor supresses
// default public constructor
private DispatchList() {
}
public static DispatchList getInstance() {
return INSTANCE;
}
private Date getMappedStartTime(int bucketID) {
Vector bucketStartDates = CalendarMap.getInstance().getBucketStartDates();
return (Date) bucketStartDates.elementAt(bucketID - 1);
}
private int getSeqInDay(int bucketID) {
Vector seqInBucket = CalendarMap.getInstance().getSeqInBucket();
return ( (Integer) seqInBucket.elementAt(bucketID - 1)).intValue();
}
public void createReport() {
ProductionStartsSchedule startsSchedule = ProductionStartsSchedule.
getInstance();
try {
//WorkingHours.getInstance().readData();
OrderDetailsManHourMap.getInstance().readData();
//PeriodDateMap.getInstance().readData();
ProcessCapabilityTable.getInstance().readData();
EmployeeAvailability.getInstance().readData();
EquipmentCapabilityTable.getInstance().readData();
}
catch (Exception e) {
System.out.println("Reading error: " + e.getMessage());
}
DataModel.getInstance().getProductDemands().genLastRoutes();
netOutWIP();
allocateDetailedOrders();
groupScheduleByBucket();
assignEmployee();
assignStartEndTime();
setDefaultTime();
//sortStarts();
//this.sortStartsByEmployee();
//assignEquipment();
//assignEquipment2();
groupStartsByEmployee();
assignEquipmentSimple();
groupScheduleByRoute();
findNextOperator();
writeDispatchList();
writeNextOperator();
createSummaryReport();
}
private String urlAddr = GlobalConfig.getInstance().getLPServerURL() +
"com.power.pipeengine.LP_ReadWriteFile";
private void writeDispatchList() {
//Vector[] startsSchedules = ProductionStartsSchedule.getInstance().getStartsSchedules();
Vector[] startsSchedules = schedulesGroupedByBucket;
StringBuffer content = new StringBuffer();
for (int i = 0; i < startsSchedules.length; i++) {
Vector allStarts = (Vector) startsSchedules[i];
if (null == allStarts || allStarts.size() == 0)
continue;
for (int j = 0; j < allStarts.size(); j++) {
StartsSchedule aSchedule = (StartsSchedule) allStarts.elementAt(j);
content.append(aSchedule.getSchedule());
}
}
URLFileWriter.getInstance().write(urlAddr,
GlobalConfig.getInstance().
getDirectOutputDir() + "dispatchlist.csv",
"WriteModel",
content.toString());
}
private void writeNextOperator() {
Vector[] startsSchedules = schedulesGroupedByBucket;
int lineNumOffset = getMaxAutoIDInDispatchList();
StringBuffer content = new StringBuffer();
for (int i = 0; i < startsSchedules.length; i++) {
Vector allStarts = (Vector) startsSchedules[i];
if (null == allStarts || allStarts.size() == 0)
continue;
for (int j = 0; j < allStarts.size(); j++) {
StartsSchedule aSchedule = (StartsSchedule) allStarts.elementAt(j);
content.append(aSchedule.getNextOperators(lineNumOffset));
}
}
URLFileWriter.getInstance().write(urlAddr,
GlobalConfig.getInstance().
getDirectOutputDir() + "nextop.csv",
"WriteModel",
content.toString());
}
int maxIndex = -1;
public int getMaxAutoIDInDispatchList() {
if (maxIndex >= 0)
return maxIndex;
BufferedReader b = null;
try {
b = URLFileReader.getInstance().getReaderForURL(urlAddr,
"ReadModel",
GlobalConfig.getInstance().getDirectInputDir() +
"maxautoidindispatchlist.csv");
}
catch (Exception e) {
MessageArea.getInstance().addMessage(
"Error opening file: maxautoidindispatchlist.csv\n");
}
try {
String line = b.readLine();
maxIndex = new Integer(line).intValue();
}
catch (Exception e) {
MessageArea.getInstance().addMessage(
"Error reading file: maxautoidindispatchlist.csv\n");
}
return maxIndex;
}
private StartsSchedule getNextSchedule(Vector aVec, int curIdx) {
if (curIdx >= (aVec.size() - 1)) {
return null;
}
return (StartsSchedule) aVec.elementAt(curIdx + 1);
}
private void removeZeroEntries() {
Vector[] startsSchedules = ProductionStartsSchedule.getInstance().
getStartsSchedules();
for (int i = 0; i < startsSchedules.length; i++) {
Vector starts = (Vector) startsSchedules[i];
if (null == starts || starts.size() == 0)
continue;
for (int j = 0; j < starts.size(); j++) {
StartsSchedule aSchedule = (StartsSchedule) starts.elementAt(j);
if (aSchedule.getStartsValue() == 0.0) {
starts.remove(j);
j--;
}
}
}
}
private Vector splitedStarts = new Vector();
public Vector getSplitedStarts() {
return splitedStarts;
}
public void netOutWIP() {
try {
CashmereWip.getInstance().readData();
}
catch (Exception e) {
System.out.println("Reading error: " + e.getMessage());
}
Vector wips = CashmereWip.getInstance().getWIPs();
for (int i = 0; i < wips.size(); i++) {
Object[] aWip = (Object[]) wips.elementAt(i);
String orderID = (String) aWip[0];
String styleID = (String) aWip[1];
Integer nextRteID = (Integer) aWip[2];
Integer qty = (Integer) aWip[3];
Route r = DataModel.getInstance().getRoutes().getRoute(nextRteID.intValue());
Vector styles = (Vector) OrderDetailsManHourMap.getInstance().getStyles(
orderID, styleID);
if (null == styles)
continue;
for (int j = 0; j < styles.size(); j++) {
Style aStyle = (Style) styles.elementAt(j);
int rteID = aStyle.getRouteID().intValue();
if (r.isAPrevRoute(rteID)) {
aStyle.reduceQty(qty.intValue());
//System.out.println("Style neted out: " + aStyle.getOrderID() + "\t" +
//aStyle.getStyleID());
}
}
}
}
public void allocateDetailedOrders() {
removeZeroEntries();
Vector[] startsSchedules = ProductionStartsSchedule.getInstance().
getStartsSchedules();
Enumeration allOdrs = OrderDetailsManHourMap.getInstance().getAllStyles().
elements();
ProductDemands prodDmds = DataModel.getInstance().getProductDemands();
while (allOdrs.hasMoreElements()) {
Style aStyle = (Style) allOdrs.nextElement();
//Vector allStarts = (Vector) startsSchedules[ rteID.intValue() - 1 ];
Integer rteID = aStyle.getRouteID();
if (null == startsSchedules[rteID.intValue() - 1])
continue;
Enumeration allStarts = startsSchedules[rteID.intValue() - 1].elements();
Vector allStartsVec = (Vector) startsSchedules[rteID.intValue(
没有合适的资源?快使用搜索试试~ 我知道了~
APS高级排产系统.7z
共710个文件
class:169个
java:163个
jpg:79个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 7 下载量 14 浏览量
2022-07-13
16:02:51
上传
评论 1
收藏 2.73MB 7Z 举报
温馨提示
今天为网友提供的是JAVA源码,全球著名IT公司ILog的APS高级排产优化引擎,就连SAP、Oracle等ERP中的物料需求计划与生产计划算法都来源于ILog。APS高级排产系统我研究了好久,中间的性线求解算法可真谓难呀。其中Tutorialcndlg.Htm是帮助文件,Src下是源代码。希望版主能给我几千分,我也想参考一下这里的几个系统。下面还会有销售性线预测系统与运输车辆优化系统。
资源推荐
资源详情
资源评论
收起资源包目录
APS高级排产系统.7z (710个子文件)
RouteProducts.back 6KB
复件 ProductionStartsSchedule.bak 16KB
LP_ConvertData.java.bak 12KB
LPURLWriter.bak 5KB
Tabledlg_zh.class 9KB
Tabledlg_en.class 9KB
Tabledlg.class 9KB
PoseTabledlg_zh.class 9KB
Constraint.class 8KB
PoseTabledlg_en.class 8KB
LogCalendar.class 8KB
PoseTabledlg.class 8KB
InventoryConstraint.class 8KB
Module.class 8KB
ModelWriter.class 7KB
FixModule.class 7KB
ModelReader.class 7KB
CapacityConstraint.class 6KB
Solve.class 6KB
ParaServlet.class 6KB
MPSReader.class 6KB
PlosResource_en.class 6KB
PlosResource.class 6KB
DataModel.class 6KB
ParaTree.class 5KB
ParaIOTree.class 5KB
StartsOutsConstraint.class 5KB
PlosResource_zh.class 5KB
ProductBoundConstraint.class 5KB
RouteProducts.class 5KB
Delinquency.class 5KB
NewUserBean.class 5KB
MaterialConstraint.class 5KB
PIPEMain.class 5KB
MinInvConstraint.class 4KB
GlobalConfig.class 4KB
InterShipment.class 4KB
SourcingConstraint.class 4KB
PMR0omMasterService.class 4KB
Model.class 4KB
ModelConstraints.class 4KB
ProductReceipt.class 4KB
ContentFactory.class 4KB
ProductDispatch.class 4KB
MaterialConsumption.class 4KB
BoundsSupport.class 4KB
ProductionOutsByRoute.class 4KB
ShipmentConstraint.class 4KB
Products.class 4KB
PoseTree.class 4KB
ProductBounds.class 4KB
ProductDemands.class 4KB
Route.class 4KB
Routes.class 4KB
RouteSources.class 4KB
Product.class 4KB
Resources.class 4KB
Facilities.class 4KB
MinInvSupport.class 3KB
LPModel.class 3KB
ResourceUses.class 3KB
ProductionPlan.class 3KB
LogView.class 3KB
InventoryCosts.class 3KB
ProductionStartsSchedule.class 3KB
PlosTree.class 3KB
MPSFileWriter.class 3KB
PdpTree.class 3KB
ResourceUsage.class 3KB
Sourcing.class 3KB
Materials.class 3KB
InventoryGroups.class 3KB
ProductionOutsSchedule.class 3KB
Inventories.class 3KB
RouteProduct.class 3KB
MinInventories.class 3KB
InventoryCost.class 3KB
MaterialUses.class 3KB
Calendar.class 3KB
Facility.class 3KB
ManageAccount.class 3KB
GlobalConfig.class 3KB
GlobalConfig.class 3KB
Resource.class 3KB
Report.class 3KB
ObjectiveFunction.class 3KB
PIPECalendar.class 3KB
MaterialUse.class 3KB
ParaTree_CN.class 3KB
ParaTree_EN.class 3KB
Shipment.class 2KB
ProductBound.class 2KB
Element.class 2KB
ShipmentVariable.class 2KB
LogRecorder.class 2KB
ModelVariables.class 2KB
Inventory.class 2KB
InputReader.class 2KB
RouteSource.class 2KB
OutsVariable.class 2KB
共 710 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
BryanDing
- 粉丝: 311
- 资源: 5578
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页