Skip to content

Commit

Permalink
Changes to make CE tests pass.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
miatauro-NASA committed Dec 4, 2014
1 parent 26bb9cd commit 1b037b7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/PLASMA/ConstraintEngine/base/ConstrainedVariable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ namespace EUROPA {

if(getCurrentDomain().isEmpty())
return;
if(internal_baseDomain().isSingleton() && !isSpecified())
internalSpecify(internal_baseDomain().getSingletonValue());
}

void ConstrainedVariable::open() {
Expand Down
1 change: 1 addition & 0 deletions src/PLASMA/ConstraintEngine/base/ConstraintEngine.hh
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ namespace EUROPA {

enum Event { UPPER_BOUND_DECREASED = 0, /**< If the upper bound of an interval domain is reduced. */
LOWER_BOUND_INCREASED, /**< If the lower bound of an interval domain is increased. */
REFTIME_CHANGED, /**< PHM Support for reftime calculations. */
BOUNDS_RESTRICTED, /**< Both upper and lower are decreased and increased respectively. */
VALUE_REMOVED, /**< A restriction to an enumerated domain. */
RESTRICT_TO_SINGLETON, /**< A restriction of the domain to a singleton value through inference. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace EUROPA{
}

EquivalenceClassCollection::EquivalenceClassCollection()
:m_requiresUpdate(false){}
: m_nodesByVar(), m_graphsByKey(), m_requiresUpdate(false), m_nextCycle(0), m_nextGraph(0) {}

EquivalenceClassCollection::~EquivalenceClassCollection(){
for(std::map<ConstrainedVariableId, ConstraintNodeId>::iterator it = m_nodesByVar.begin(); it != m_nodesByVar.end(); ++it)
Expand Down

0 comments on commit 1b037b7

Please sign in to comment.