r中的二进制选择变量的整数优化
我正在处理一个优化问题,其中我的选择变量(是否构建)是二进制变量。所附的照片显示了最佳的构建选择(在Excel中使用求解器解决)。
我试图在R中复制此问题。将预期价值(EV)的总和限制为≤30,并将选择作为选择变量。
问题在于,EV随构建决策的给定组合而变化。它的一般公式是:
ev =火的概率(p)*损坏(发生火灾时) +(1-p)*损坏(无火) +成本(k)。
没有火灾时损坏为0。当有火灾并且地块上没有塔时,地块上没有塔楼时,地块上没有塔楼时,高损坏。
so ev = p*损坏(火状态) +成本
。 (大小或其他属性无关紧要)。 H:高伤害。仅当没有建立决定时,高伤害。 L:损坏低。如果我们选择在给定的地块中建造塔楼,那么低伤害。 P:火的概率。 K:建筑观察塔的成本。 给定的b配置文件:b是二进制变量。 b = 1表示我们选择在给定图中构建。 EV(B = 1):如果我们选择构建,则期望值。 EV(B = 0):如果我们不构建,则期望值。 EV:最终期望值。如果我们构建,EV = EV(B = 1)ERSE EV = EV(B = 0)。预算约束:如果我们建造,它等于建筑物的成本,否则为0。
I am working on an optimization problem in which my choice variable (to build or not) is a binary variable. The photo attached shows the optimal build choices (solved using Solver in Excel).
I am trying to replicate this problem in R. Minimizing the sum of expected value (EV) with the budget constraint ≤ 30 and build choices as the choice variable.
The problem is that EV changes with the given combination of build decisions. The general formula for it is:
EV = probability of fire (p)*Damage(when there is a fire) + (1-p)*Damage (no fire) + Cost (K).
Damage is 0 when there is no fire. High damage when there is a fire and the plot does not have a tower and low damage when the plot has a tower built on it.
So EV = p*Damage(fire state) + Cost
Plot i: Ten plots of land (size or other attributes do not matter).
H: High damage. High damage only if there is no build decision.
L: Low damage. Low damage if we chose to build a tower in a given plot.
p: Probability of fire.
K: Cost of building watch tower.
Given B profile: B is a binary variable. B=1 signifies we chose to built in the given plot. EV(B=1): Expected value if we chose to build. EV(B=0): Expected value if we do not build. EV: Final expected value. If we build, EV = EV(B=1) else EV = EV(B=0). Budget constraint: If we build, it is equal to the cost of building, else it is 0.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过对每行有两个变量来表达您的问题作为二进制线性。那些变量对以下方式连接:
data
其中
total_budget 是您预算的上限。
You can express your problem as binary linear one by having two variables for each row. Those pair of varibles are connected in following way:
data
solution
where
total_budget
is upper limit on your budget.