Hi,
okay sure, I will try to introduce my model and thoughts as compact as possible:
I changed the model a little bit within the last 2 days.
The overall goal is to develop a model for urban city planers, like very basic in the beginning starting with an empty map which should stand for a new suburb for example. In the model we have p=1…P Pixels which the model should fill with one of six options o=1…O. The options are either a house or a tree. Each of the six options has his own properties, the first 3 options are /house1house3/ which stands for 3 different house types each with individual cost and resident capacity. The second three options are /veg1veg3/ and have costs as well and a resident capacity of 0. The model should consider Budget and Resident demand constraints but thats easy to implement. The overall goal of the model is an allocation which considers economic and eco goals so every option o=1…O has a property dealding with a temperature delta (the houses leads to a positive temp delta due to Urban heat island effect and the vegetation has an positive impact on the temp, so negative temp delta). The objective function minimizes the overall temp. delta und Budget and Demand restrictions. I have a restriction as well, that every p of P should be allocate exactly one time. So in the end the model tells me after optimizing on which pixel p of P which option o of O is allocated and which ofv (temp delta) the optimzation has.
Hopefully you can follow me till now?
I have one binary variable x(p,o)=1 which is 1 if on pixel p of P option o of O is placed by the model.
As density is one of the leading factors of UHI I definitly want to integrate that in my model and in that way I want to maximze the distance between the pixel allocated with a house either its option 1,2 oder 3.
Do you have any idea how I can archieve this?
Here is my model so far:
Set
p
o
h(o)
pbuilt(p)
;
alias(p,j)
Set Nachbar(p,j);
Parameter
c(o)
D
B
kx(p)
ky(p)
t(o)
s(o)
w(p,j)
l(o)
F
a(o)
q(o)
;
binary variable
x(p,o)
;
free variable
ofv
R
Dis
;
equations
ObjectiveFunction
MapDemand
MapBudget
EachPixelOnce
Result
Distance
;
ObjectiveFunction..
sum(p,sum(o,x(p,o)*t(o))) - sum(p,sum(o,x(p,o)*l(o))) + sum(p,sum(o,x(p,o)*a(o)*F)) =e= ofv
;
MapDemand..
sum(p,sum(o$ h(o),x(p,o)*s(o))) =g= D
;
MapBudget..
sum(p,sum(o,x(p,o)*c(o))) =l= B
;
EachPixelOnce(p)..
sum(o,x(p,o)) =e= 1
;
Result..
sum(p,sum(o,x(p,o)*t(o)))+ sum(p,sum(o,x(p,o)*a(o)*F)) =e= R
;
Distance..
sum(p,sum(o,(q(o)*x(p,o)*(sum(j,w(p,j)*q(o)))))) =e= Dis
;
*Distance..
*sum(p,sum(o,x(p,o)*q(o)*sum(j$(x(p,o)*q(o)>0),w(p,j)))) =e= Dis
*;
$include includeModelV2.inc
model problem /all/;
solve problem using mip minimizing ofv;
display ofv.l, x.l, w, h, R.l, Dis.l;
Include file:
Set
p /Cell1*Cell9/
o /Option1*Option6/
h(o) /Option1*Option3/
pbuilt(p)
;
Parameter
F
/
2
/
B
/
1000
/
D
/
10
/
t(o)
/
Option1 0.15
Option2 0.2
Option3 0.3
Option4 -0.1
Option5 -0.15
Option6 -0.2
/
c(o)
/
Option1 150
Option2 200
Option3 300
Option4 10
Option5 20
Option6 30
/
l(o)
/
Option1 6
Option2 8
Option3 10
Option4 0
Option5 0
Option6 0
/
q(o)
/
Option1 1
Option2 1
Option3 1
Option4 0
Option5 0
Option6 0
/
a(o)
/
Option1 0.5
Option2 0.35
Option3 0.4
Option4 -0.01
Option5 -0.05
Option6 -0.08
/
s(o)
/
Option1 2
Option2 5
Option3 8
Option4 0
Option5 0
Option6 0
/
kx(p)
/
Cell1 1
Cell2 2
Cell3 3
Cell4 1
Cell5 2
Cell6 3
Cell7 1
Cell8 2
Cell9 3
/
ky(p)
/
Cell1 1
Cell2 1
Cell3 1
Cell4 2
Cell5 2
Cell6 2
Cell7 3
Cell8 3
Cell9 3
/
;
loop((p,j),w(p,j)=abs(kx(p)-kx(j))+abs(ky(p)-ky(j)));