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

Redundancies (and lack of type-safety) in ConstraintEngine::ChangeType and DomainListener::ChangeType #166

Open
miatauro-NASA opened this issue Dec 4, 2014 · 2 comments

Comments

@miatauro-NASA
Copy link
Contributor

The first several members of the ConstraintEngine::ChangeType and DomainListener::ChangeType are redundant. Further, they must be kept in sync and are inter-convertable, which can lead to very strange bugs. There should be only one enumeration for these values, and possibly a type-safe idiom (or possibly wholesale movement to C++11's safe enums) should be used.

miatauro-NASA added a commit that referenced this issue Dec 4, 2014
Closing a singleton base domain now marks the variable as specified.
This seems inconsistent with a previous commit to distinguish specified
variables from variables with singleton base domains, but that commit
didn't touch Variable::handleRestrictBaseDomain, which does specify
variables whose base domain gets restricted to a singleton.  This should
be clarified and made consistent. See issue #165.

Made the beginning of the ConstraintEngine::ChangeType enumeration and
the DomainListener::ChangeType enumeration into line.  See issue #166

Added initializers to the EquivalenceClassCollection constructor, which
caused some random test failures sometimes.
@phmorris
Copy link
Contributor

phmorris commented Dec 4, 2014

As a point of information,

DomainListener::ChangeType

is used in

DynamicEuropa/ActivityEngine/ReftimeProfile.cc

which is in a separate repository from Europa. So if only one is kept,
maybe this could be the one?

Paul

On 12/04/14 11:28 AM, miatauro-NASA wrote:

The first several members of the ConstraintEngine::ChangeType and DomainListener::ChangeType are redundant. Further, they must be kept in sync and are inter-convertable, which can lead to very strange bugs. There should be only one enumeration for these values, and possibly a type-safe idiom (or possibly wholesale movement to C++11's safe enums) should be used.


Reply to this email directly or view it on GitHub:
#166

@miatauro-NASA
Copy link
Contributor Author

It definitely should stay. I suspect the right thing to do is to keep them both, but remove the redundant entries from ConstraintEngine::ChangeType and let the ConstraintEngine re-publish DomainListener::ChangeType messages.

miatauro-NASA added a commit that referenced this issue May 27, 2021
Closing a singleton base domain now marks the variable as specified.
This seems inconsistent with a previous commit to distinguish specified
variables from variables with singleton base domains, but that commit
didn't touch Variable::handleRestrictBaseDomain, which does specify
variables whose base domain gets restricted to a singleton.  This should
be clarified and made consistent. See issue #165.

Made the beginning of the ConstraintEngine::ChangeType enumeration and
the DomainListener::ChangeType enumeration into line.  See issue #166

Added initializers to the EquivalenceClassCollection constructor, which
caused some random test failures sometimes.
miatauro-NASA added a commit that referenced this issue May 27, 2021
Closing a singleton base domain now marks the variable as specified.
This seems inconsistent with a previous commit to distinguish specified
variables from variables with singleton base domains, but that commit
didn't touch Variable::handleRestrictBaseDomain, which does specify
variables whose base domain gets restricted to a singleton.  This should
be clarified and made consistent. See issue #165.

Made the beginning of the ConstraintEngine::ChangeType enumeration and
the DomainListener::ChangeType enumeration into line.  See issue #166

Added initializers to the EquivalenceClassCollection constructor, which
caused some random test failures sometimes.
lsylusiyao pushed a commit to lsylusiyao/europa that referenced this issue Oct 25, 2022
Closing a singleton base domain now marks the variable as specified.
This seems inconsistent with a previous commit to distinguish specified
variables from variables with singleton base domains, but that commit
didn't touch Variable::handleRestrictBaseDomain, which does specify
variables whose base domain gets restricted to a singleton.  This should
be clarified and made consistent. See issue nasa#165.

Made the beginning of the ConstraintEngine::ChangeType enumeration and
the DomainListener::ChangeType enumeration into line.  See issue nasa#166

Added initializers to the EquivalenceClassCollection constructor, which
caused some random test failures sometimes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants