Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When multiple models are loaded, postprocessing is performed only on the first one #10

Open
vlkong opened this issue Oct 9, 2020 · 3 comments · Fixed by #11
Open

When multiple models are loaded, postprocessing is performed only on the first one #10

vlkong opened this issue Oct 9, 2020 · 3 comments · Fixed by #11
Assignees
Labels
bug Something isn't working

Comments

@vlkong
Copy link
Member

vlkong commented Oct 9, 2020

Let's consider this code:


 main
 {	
	function loadAndSolve(model_mod, model_dat) {
		writeln("Solving " + model_mod);	
		var cplex1 = new IloCplex();
		var source1 = new IloOplModelSource(model_mod);
		var def1 = new IloOplModelDefinition(source1);
		var opl1 = new IloOplModel(def1, cplex1);
		var data1 = new IloOplDataSource(model_dat);
		
		opl1.settings.mainEndEnabled=true;
		opl1.addDataSource(data1);
		opl1.generate();
		
		if (cplex1.solve())
		{
			writeln("successfully solved " + model_mod);
			opl1.postProcess();      
		}
		else {writeln("No solution found for " + model_mod);}  
			
		opl1.end();
	}
	loadAndSolve("model1.mod", "model1.dat");
	loadAndSolve("model2.mod", "model2.dat");
 }

We expect that model1.mod is loaded/solved, then any output for model1.mod to be saved.
Then model2.mod is loaded/solved, then any output for model2.mod` is saved.

However only the output of model1.mod is triggered.

@vlkong vlkong self-assigned this Oct 9, 2020
@vlkong vlkong added the bug Something isn't working label Oct 9, 2020
@vlkong
Copy link
Member Author

vlkong commented Oct 9, 2020

The reason for this behaviour is that db connection update() statements are triggered at postprocessing, but the postprocessing callback is only registered to the first model. Working on a fix + tests for this.

@vlkong vlkong mentioned this issue Oct 9, 2020
@vlkong
Copy link
Member Author

vlkong commented Oct 9, 2020

fixed in 1.13.4

@vlkong vlkong closed this as completed Oct 9, 2020
@vlkong vlkong reopened this Oct 13, 2020
@vlkong
Copy link
Member Author

vlkong commented Oct 13, 2020

1.3.4 did not contain the right changes
Right changes are in 1.3.5
Sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant