Originally posted by: SystemAdmin
using CP;
//TAZ影响区个数;
int infCount=...;
//最大TAZ个数(TAZ中心点个数);
int maxTAZNum=...;
//最小TAZ个数(TAZ中心点个数);
int minTAZNum=...;
//TAZ索引范围(TAZ中心点取值范围,TAZ个数取值范围);
range ithCenInf=1..infCount;
//TAZ影响区索引(TAZ影响区个数取值范围);
range jthInf=1..infCount;
//各个影响区的需求
int DemandjthInf=...;
//影响区j到TAZi中心影响区的距离;
float DistanceithCenInfjthInf=...;
//单个Cell的面积
float CellArea=...;
//以第i个Inf为中心的TAZ最小的面积=0.7乘以第i个Inf的面积;
float MinTazAreaithCenInf=...;
float Sum2LD=...;
float LocalDepthjthInf=...;
int ComPool
ithCenInfjthInf=...;
dvar int CompositionsithCenInfjthInf in 0..1;
dvar int CenInfsithCenInf in 0..1;
dvar int K in minTAZNum..maxTAZNum;
minimize
sum(i in ithCenInf, j in jthInf) Compositions[i][j]*Distance[i][j]*Demand[j];
subject to {
forall(i in ithCenInf, j in jthInf)
ct0:
CenInfs[i]>=Compositions[i][j];
ct1:
sum(i in ithCenInf) CenInfs[i]==K;
ct2:
sum(i in ithCenInf, j in jthInf) Compositions[i][j]==infCount;
forall(j in jthInf)
ct3:
sum (i in ithCenInf) Compositions[i][j]<=1;
forall(i in ithCenInf)
ct4:
sum(j in jthInf) CellArea*Compositions[i][j]>=MinTazArea[i]*CenInfs[i];
forall(i in ithCenInf)
ct5:
sum(j in jthInf) LocalDepth[j]*Compositions[i][j]>=0.7*(Sum2LD/K);
forall(i in ithCenInf, j in jthInf)
ct6:
Compositions[i][j]<=ComPool[i][j];
}
******************************************
it meant to solve the following problem:
******************************************
jthInf
0 1 2 .... 902
+--+--+--+--+--+--+
0 | | | | | | | -----> Compositions[0][0]...Compositions[0]902
i +--+--+--+--+--+--+
t 1 | | | | | | | -----> Compositions[1][0]...Compositions[1]902
h +--+--+--+--+--+--+
I . | | | | | | | .
n . +--+--+--+--+--+--+ .
f . | | | | | | | .
+--+--+--+--+--+--+
902 | | | | | | | -----> Compositions902[0]...Compositions902902
+--+--+--+--+--+--+
The model delineates zoning system, according to its goals, for a defined range of number of zones(i.e.,minTAZNum..maxTAZNum), and calculates the optimal number and compositions of zones for that range.
******************************************
.data is like the following :
******************************************
infCount=903;
maxTAZNum=903;
minTAZNum=1;
Demand=(1*903 array);
Distance=(903*903 double matrix );
CellArea=0.656;
MinTazArea=(1*903 array);
Sum2LD=625423.0;
LocalDepth=(1*903 array);
******************************************
Error :
******************************************
Always, at about one and half minites, there goes the error: not enough memory.
I think maybe:
1.the .data size is too large?(and is there a limit about a model input data in ilog cplex?)
2.can we exploit much more memory for cplex by some kind of configuration or change a better computer??
3.the model should be decompose by methods like column generation?
but if it is the situation "3", how can i realize the decomposition?
Or is there any other reasons that cause this problem?
please help~!!
#CPLEXOptimizers#DecisionOptimization