How can I fix data element “;” unexpected “?” error and modify data for more than 3 dimension array?

I’m a CPLEX beginer and currently try to practicing on a multi-objective model for personal learning with the code and input data below:

int Typeprod=...; //type of  product //
int Supplierloca=...; //supplier location //
{int} J1=...; //locations of existing whs//
{int} J2=...; //mobile facilities locations//
{int} J= J1 inter J2; //possible location of whs //
int NumbDC=...; //number of distribution centers//
int Customer=...; //number of customer //
int Timeperiod=...; //time periods//
int Routes=...; //number of routes//
int NumbDisasterscenario=...; //number of scenario//


//range of sets and input data//
range M=1..Typeprod; // m type of prod//
range I= 1..Supplierloca; //supplier location i//
range K=1..NumbDC; // k distribution centers//
range L=1..Customer; //l customer//
range T=1..Timeperiod; //time t//
range R=1..Routes; //route r//
range S=1..NumbDisasterscenario; //disaster scenario s//


//parameters or input data//
float Pi[S]=...; //probability of disaster//
int o=...; //fixed cost of establishing a mobile facility//
int q=...; //equipping cost of existing whs//
int e[K]=...; //capacity of DC k //
int f[J1]=...; //capacity of a product reception by existing whs at location j1//
int c[J2]=...; // para chua dc them vào report- - by mobile facilities// 
int p[S][I][T]=...; //expected supply of product at location i and period t under scenario s//
//tuple set for 
float Psi[I][M]=...; //exchange rate of product m at location i//
int d[S][M][L][T]=...; //product demand at customer l in period t under s//
int ti[L][T]=...; //travel time from DC in other place to cus l in period t//
int t1[J][K][R]=...; //travel time from whs j to dc k with route r//
int t2[K][L]=...; //travel time from DC k to customer l//
int Alpha[S][J1][T]=...; //equal to 1 if J1 is disrupted//
int Beta[S][K][T]=...; // equal to 1 if DC k is disrupted//
int Xi[S][J][K][R][T]=...; //equal to 1 if route r between whs J and DC k is disrupted//
int N=...; //number of mobile whs//

//decision variables//

//int+//
dvar int+ V[S][M][K][T];
dvar int+ F[S][M][J][K][T][R];
dvar int+ U[S][M][K][L][T];
dvar int+ G[S][I][J][T];
dvar int+ H[S][M][L][T];

//binary//
dvar boolean Z[J1];
dvar boolean Y[S][J2][I];
dvar boolean X[S][J][K][R][T];
dvar boolean W[S][J][I][T];

//objective functions//

//Minimize delivery time//
minimize 
sum(m in M,j in J,k in K,t in T, r in R, s in S)Pi[s]*F[s][m][j][k][t][r]*t1[j][k][r] +
 sum(m in M,k in K, l in L,t in T,s in S)Pi[s]*U[s][m][k][l][t]*t2[k][l] +
  sum(m in M,l in L,t in T,s in S)Pi[s]*H[s][m][l][t]*ti[l][t]; 

//Minimize total costs//
minimize 
o*N + sum(j in J1)q*Z[j];

subject to {

//3-4 quantity of product from each urban area not exceed expected supply of products//
forall (i in I, j in J, t in T, s in S){
 G[s][i][j][t] <= p[s][i][t]*W[s][j][i][t]; 
 sum(j in J) G[s][i][j][t] <= p[s][i][t];   
}

//5- Limit the capacity of whs at each facility - cannot exceed total capacity from existing and mobile whs//
forall ( j in J, j1 in J1, j2 in J2, t in T, s in S, i in I){
 sum(i in I) G[s][i][j][t] <= Z[j1]*f[j1] + c[j2]*Y[s][j2][i];  //remember to add this para cj into report//
}

//6- In each location, one of existing whs or mobile facility is established//
forall (j1 in J1,j2 in J2, t in T, s in S, i in I){
 Z[j1]+Y[s][j2][i] <= 1;  //6//
}

//7 - Suppliers can only be assigned to exist whs that not disrupted//
forall ( j in J, i in I, j1 in J1, j2 in J2, t in T, s in S){ 
 W[s][i][j][t] <= (1- Alpha[s][j1][t])*Z[j1] + Y[s][j2][i];
}

//8 - Value of prod m output is less than the input value at whs//
forall (m in M, j in J, t in T, s in S, r in R){
 sum(k in K, t in T)F[s][m][j][k][t][r] <= sum (i in I)Psi[i][m]*G[s][i][j][t];
}

//9- Capacity at each DC k without disruption//
forall (k in K, t in T, s in S){
 sum(j in J, r in R, m in M)F[s][m][j][k][t][r] <= e[k]*(1- Beta[s][k][t]);
}

//10 - If whs j1 is assigned to DC k, facilities and routes are not disrupted//
forall (j in J, j1 in J1, k in K, t in T, r in R, s in S) {
X[s][j][k][t][r] <= (1- Alpha[s][j1][t])*(1- Beta[s][k][t])*(1- Xi[s][j][k][r][t])*Z[j1];
}

//11 - If a mobile facility j2 is assign to DC k, facility is not disrupted//
forall (j in J, j2 in J2, k in K, t in T, r in R, s in S) {
X[s][j][k][t][r] <= Y[s][j2][t]*(1- Beta[s][k][t])*(1- Xi[s][j][k][r][t]);
}

//12 - One route is allocated between each WHS and DC//
forall (j in J, k in K, t in T, s in S) {
sum(r in R)X[s][j][k][t][r] <= 1;
}
 
//13 - Only one WHS is assigned to one DC//
forall (j in J, t in T, s in S) {
sum(k in K, r in R)X[s][j][k][t][r] <= 1;
}

//14 - Products cannot be transported from a mobile WHS to an unassigned DC//
forall ( k in K, j in J, j2 in J2, t in T, r in R, s in S) {
sum( m in M)F[s][m][j][k][t][r] <= c[j2]*X[s][j][k][t][r];
}

//15 - A DC can be assigned to customer when not disrupted only //
forall (k in K, t in T, s in S){
  sum(m in M, l in L)U[s][m][k][l][t] <= e[k]*(1- Beta[s][k][t]);
} 

//16 - The amount of products delivered to each customer from DCs in other provinces//
forall (m in M, l in L, t in T, s in S) {
d[s][m][l][t] - sum(k in K)U[s][m][k][l][t] == H[s][m][l][t];
}

//17 - Product inventory balance at DCs//
forall (m in M, k in K, t in T, s in S) {
V[s][m][k][t-1]+sum(j in J, r in R)F[s][m][j][k][t][r] == V[s][m][k][t] + sum(l in L)U[s][m][k][l][t];
}

//18 - The number of mobile WHS in each period t does not exceed the number of established mobile facilities//
forall (t in T, s in S) {
sum(j in J2)Y[s][j][t] <= N;
}

//19 - Capacities for storing at DC k // 
forall (k in K, t in T, s in S) {
sum(m in M)V[s][m][k][t] <= e[k];
}

//20 - Eligible domains of decision variables//
forall (m in M, i in I, j in J, k in K, l in L, t in T, r in R, s in S) {
V[s][m][k][t] >= 0;
F[s][m][j][k][t][r] >= 0;
U[s][m][k][l][t] >= 0;
G[s][i][j][t] >= 0;
H[s][m][l][t] >= 0;
0 <= Z[j] <=1; 
0 <= Y[s][j][t] <=1;
0 <= X[s][j][k][t][r] <=1;
0 <= W[s][i][j][t] <=1;
}
}

Input data is given as below:

 Typeprod= 1 ;
 Supplierloca= 1 ;
 J1= {1}  ;
 J2= {2}  ;
 N= 1;
 NumbDC= 1 ;
 Customer= 1 ;
 Timeperiod= 12 ;
 Routes= 1 ;

 NumbDisasterscenario= 1;

//probability of scenario//
 Pi= 0.1; 
 
 o= 180 ;

 q= 1000 ;

 e= 3500 ; 

 f= 4500 ; 
 
 c= 900 ; 
 
 p= [ [600, 520, 370, 150, 250, 440, 350, 380, 500, 610, 740, 380];
 
 Psi= 0.05;
 
 d= [150, 170, 300, 220, 110, 550, 50, 190, 70, 120, 60, 1420, 320]  ;
 
 ti= [70 85 100 95 90 60 75 70 65 85 80 90 ]  ;
 
 t1= 35 ;
 
 t2= 45  ;

 Alpha= 0;
 
 Beta= 0 ;
 
 Xi= 0;

The problem occurs at data line of Pi=0.1, which cause the error: data element “;” unexpected “?”, is there any chance that I’ve defined the datatype incorrectly? Moreover, I am still struggling to modify some specific data since it has too many indexes (for example: Product demand for product M, customer L in period T and under scenario S => d[S][M][L][T]. )

Hence, how can I fix this problem and modify the data type to reach the requirements?

Thank you so much and have a nice day!

New contributor

Yeon Dong is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật