Reading the model from a file

The sample reads a model from a file for extraction later.

The model is created by reading it from the file specified as the first command line argument argv[1] . The method importModel of an IloCplex object reads the model from the file but it does not extract the model for solution. That is, in this case, the IloCplex object is used as a model reader rather than an optimizer. Calling importModel does not extract the model to the invoking cplex object. Consequently, extraction must be done later by a call to cplex.extract(model). The objects obj , var , and rng are passed to importModel so that later on, when results are queried, the variables will be accessible.