Originally posted by: JodokusQuak
The lines in bold are the first errors.
#include<iostream>
#include<ilcplex/ilocplex.h>
#include<fstream>
#include<iomanip>
#include<time.h>
using namespace std;
int main() {
/*definition of the environment & the model*/
IloEnv env;
IloModel model(env);
/*********************************************************************************************************************************************
*1. data
*********************************************************************************************************************************************/
/*1.1 import data*/
ifstream myfile("folder_path");
if (!myfile) {
cout << "nothing was found" << endl;
system("break");
return 1;
}
/*1.2 Sets*/
IloInt B;
IloInt V;
IloInt V_b;
IloInt F;
IloInt A;
IloInt A_f;
IloInt A_v;
IloInt T;
IloInt P;
IloInt I;
/*1.3 parameters*/
IloIntArray t_penalty(env);
IloIntArray n_tech(env);
IloIntArray n_techatbase(env);
IloIntArray n_techcap(env);
IloIntArray speed(env);
IloIntArray b_service(env);
IloIntArray v_available(env);
IloIntArray v_skill(env);
IloIntArray parts_available(env);
IloFloatArray t_work(env);
IloFloatArray t_transfer(env);
IloFloatArray w_spareparts(env);
IloFloatArray c_tech(env);
IloFloatArray c_penalty(env);
IloFloatArray w_sparepartscap(env);
IloFloatArray c_fuel(env);
IloFloatArray t_weather(env);
IloFloatArray c_route(env);
/*1.4 assign parameters to data*/
myfile >> B;
myfile >> V;
myfile >> V_b;
myfile >> F;
myfile >> A;
myfile >> A_f;
myfile >> A_v;
myfile >> T;
myfile >> P;
myfile >> I;
myfile >> t_penalty;
myfile >> n_tech;
myfile >> n_techatbase;
myfile >> n_techcap;
myfile >> speed;
myfile >> b_service;
myfile >> v_available;
myfile >> v_skill;
myfile >> parts_available;
myfile >> t_work;
myfile >> t_transfer;
myfile >> w_spareparts;
myfile >> c_tech;
myfile >> c_penalty;
myfile >> w_sparepartscap;
myfile >> c_fuel;
myfile >> t_weather;
myfile >> c_route;
/*1.5 t_travel[v][i][j]*/
IloArray<IloArray<IloIntArray> > t_travel(env, V);
for (int v = 0; v < V; v++){
t_travel[v] = IloArray<IloIntArray> (env, I); //invalid use of incomplete type 'IloArray<IloIntArray>'
for (int i = 0; i < I; i++){
t_travel[v][i] = IloIntArray (env, I); //Type 'IloArray<IloIntArray>' does not provide a subscript operator
}
}
return 0;
}
#CPLEXOptimizers#DecisionOptimization