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

[CP] No easy way to generate a multiple of a variable, y = ax #196

Closed
3rdCore opened this issue Feb 15, 2022 · 0 comments
Closed

[CP] No easy way to generate a multiple of a variable, y = ax #196

3rdCore opened this issue Feb 15, 2022 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@3rdCore
Copy link
Collaborator

3rdCore commented Feb 15, 2022

By now, to generate an multiple of a variable of the form y = ax, one needs to proceed as follow :

a = 3
x = SeaPearl.IntVar(1, 5, "x", trailer)
y = SeaPearl.IntDomainViewMul(x.domain, a)

It would be nice to somehow overwrite the base operator * to automatically generate a IntDomainViewMul variable. This would be a good feature to facilitate future CP problem implementation and can be a nice good first issue for a newcomer.

@3rdCore 3rdCore added enhancement New feature or request good first issue Good for newcomers labels Feb 15, 2022
@3rdCore 3rdCore changed the title [CP] No easy way to generate an offseted variable y = ax [CP] No easy way to generate a multiple of a variable, y = ax Feb 15, 2022
louis-gautier added a commit that referenced this issue Apr 28, 2022
* Overloaded the * operator to solve issue #196

* Added isbinaryand constraint

* Added tests for isbinaryand constraint

* Added binaryimplication constraint and associated tests7

* Added binaryimplication constraint and associated tests

* Added binaryequivalence constraint and associated tests

* Changed returned type of y=a*x to IntVarViewMul

* Fixed mistake during merge
gostreap added a commit that referenced this issue May 4, 2022
…on`. (#221)

* Overloaded the * operator to solve issue #196

* Added isbinaryand constraint

* Added tests for isbinaryand constraint

* Added binaryimplication constraint and associated tests7

* Added binaryimplication constraint and associated tests

* Added binaryequivalence constraint and associated tests

* Changed returned type of y=a*x to IntVarViewMul

* Beginning to work on new default node features with featurization helper

* Initialized new features with FeaturizationHelper

* Fix featurize with FeaturizationHelper

* Add update_features

* Propagated chosen features to defaultstaterepresentation.jl

* Fixed merge mistake

* Various bug fixes for implementing FeaturizationHelper

* Override update_with_cpmodel! for DefaultStateRepresentation

* Add valueToID to DefaultStateRepresentation

* Change ValueToId to ValueToPos

* Rename to valueToPos in constructor DefaultStateRepresentation

* Implemented propagation counter for each constraint as a new feature

* Added constraint type one-hot encoding as new default feature

* First version of unit tests for FeaturizationHelper

* Solved issues leading to unit test fails

* Add nb_not_bound_variable

* Add variable domain_size and is_bound to default representation

* more consistant featurizationHelper

* Comments

* Remove FeaturizationHelper and add comment

* Fix comments

* Update comments

* Re adds feature_length for type

* Small fix: change DefaultFeaturization line of definition

* Call featurize with no chosen_features parameters if chosen_features is nothing

Co-authored-by: louis-gautier <louisgautier99@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants