//
// Copyright (c) 2009 Froduald Kabanza and the Université de Sherbrooke.
// Use of this software is permitted for non-commercial research purposes, and
// it may be copied or applied only for that use. All copies must include this
// copyright message.
// 
// This is a research prototype that has not gone through intensive tests and
// is delivered as is. It may still contain bugs. Froduald Kabanza and the
// Université de Sherbrooke disclaim any responsibility for damage that may be
// caused by using it.
//
// Please note that this file was inspired in part by the PDDL4J library:
// http://www.math-info.univ-paris5.fr/~pellier/software/software.php 
//
// Implementation: Daniel Castonguay
// Project Manager: Froduald Kabanza
//

#include "stdafx.h"
#include "NoEffect.h"
#include "../../World/IDurativeClosedWorld.h"

#include <assert.h>

using namespace planning;

NoEffect NoEffect::s_instance;

NoEffect::NoEffect()
{
  _markAsStatic();
  _setHashCode(_calculateHashCode());
}

void NoEffect::update(const IClosedWorld*, IDurativeClosedWorld*, 
                     const Bindings*, const ActionContext*) const
{
}

void NoEffect::_output(std::ostream& out) const
{
  out << "true";
}

const IExp* NoEffect::_internalApply(const Bindings* bindings) const
{
  return this;
}

int NoEffect::_internalCompareTo(const IExp& other) const
{
  return 0;
}
