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

Serial filter(...) expression: Missing filter operations in generated code #128

Open
2 tasks
maxkratz opened this issue Nov 15, 2023 · 0 comments
Open
2 tasks
Labels
bug Something isn't working

Comments

@maxkratz
Copy link
Member

(This issue may be related to #90, but maybe it is a duplicate and I did not get the issue right the first time.)

At least in some cases, concatenated filter(...) expressions do not produce correct generated code:

objective formerValue -> mapping::move {
	patterns.findComponentInFormerSystem
		->filter(m | m.nodes().s == self.nodes().newSystem)
		->filter(m | m.nodes().c1 == self.nodes().component)
		->count()
		* self.value()
}

Generated code:

@Override
protected void buildTerms(final MoveMapping context) {
terms.add(new ILPTerm(context, engine.getEMoflonAPI().findComponentInFormerSystem().findMatches(false).parallelStream()
			.filter(itr_0 -> itr_0.getS().equals(context.getNewSystem()))
			.map(itr_0 -> 1.0 * 1.0)
			[...]
}

TODO:

  • Create a test case + PR
  • Link the PR to this issue
@maxkratz maxkratz added the bug Something isn't working label Nov 15, 2023
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

No branches or pull requests

1 participant