与Delta有关的几个表-备看录

与Delta有关的几个表
R/3

BWOM2_TIMEST   BW CO-OM: 增量提取的时戳表
BWOM_SETTINGS  BW CO-OM: 控制数据

ROOSOURCE      SAP BW OLTP DATASOURCE的一些源的属性表
RODELTAM       BW Delta 进程


BW
RSOLTPSOURCE

 

-------------------------------------------------------

现在做BW的人越来越多了,一定要保持自己的竞争力!

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/554557/viewspace-696348/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/554557/viewspace-696348/

import numpy as np import math # 输入数据(补充部分) demand = [8500, 7500, 6000, 7000, 8000, 6500, 7000, 9800, 9500, 9000, 8500, 9200] # 月需求量 capacity = [8600, 7740, 9460, 8600, 9460, 8600, 9460, 9890, 9890, 9460, 8600, 9030] # 月自产产能 K = 6 # 安全库存 S0 = 1000 # 初始库存 # ---------------------- 新增函数定义 ---------------------- def initialize_solution(): """生成初始解:在产能范围内随机生成生产计划""" return [np.random.randint(0, cap) for cap in capacity] def generate_neighbor(current_solution): """生成邻域解:随机调整某个月的生产量(±5%)""" new_solution = current_solution.copy() month = np.random.randint(0, 12) delta = int(0.05 * capacity[month] * np.random.choice([-1, 1])) new_solution[month] = np.clip(new_solution[month] + delta, 0, capacity[month]) return new_solution # ---------------------- 模拟退火算法 ---------------------- def simulated_annealing(): # 参数设置 T0 = 1000 T_min = 1e-5 alpha = 0.95 L = 100 current_solution = initialize_solution() best_solution = current_solution.copy() current_cost = objective_function(current_solution) best_cost = current_cost T = T0 while T > T_min: for _ in range(L): new_solution = generate_neighbor(current_solution) new_cost = objective_function(new_solution) delta = new_cost - current_cost if delta < 0 or np.random.rand() < math.exp(-delta / T): current_solution = new_solution.copy() current_cost = new_cost if current_cost < best_cost: best_solution = current_solution.copy() best_cost = current_cost T *= alpha return best_solution, best_cost # ---------------------- 目标函数 ---------------------- def objective_function(P): S = [S0] total_cost = 0 penalty = 0 for t in range(12): S_next = S[t] + P[t] - demand[t] # 安全库存约束检查 if S_next < K: penalty += 1e6 # 提前3个月货约束检查(公式11) if t <= 9: sum_S = sum(S[t:t+3]) + sum(P[t:t+3]) sum_D = sum(demand[t:t+3]) if sum_S < sum_D: penalty += 1e6 total_cost += (S[t] + P[t] - demand[t])**2 S.append(S_next) return total_cost + penalty # 运行多次取最优解 best_global_plan, best_global_cost = None, float('inf') for _ in range(50): plan, cost = simulated_annealing() if cost < best_global_cost: best_global_plan, best_global_cost = plan, cost # ---------------------- 运行并输出结果 ---------------------- if __name__ == "__main__": best_plan, cost = simulated_annealing() print("优化后生产计划(每月生产量):", best_plan) print("目标函数值(库存波动 + 惩罚项):", cost) 给这串代码增加一个可视化的功能,能够显示算法的迭代轨迹
最新发布
05-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值