//
// 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: Simon Chamberland
// Project Manager: Froduald Kabanza
//

#ifndef _LESS_EQUAL_COMP_EXP_H
#define _LESS_EQUAL_COMP_EXP_H

#include "NumericCompExp.h"

namespace planning
{
  /// <summary>
  /// This class implements the greater numeric comparison.
  /// </summary>
  class LessEqualCompExp : public NumericCompExp<std::less_equal<double> >
  {
  public:
    /// <summary>
    /// Creates a new greater numeric comparison.
    /// </summary>
    /// <param name="arg1">The first argument.</param>
    /// <param name="arg2">The second argument.</param>
    LessEqualCompExp(const INumericExp* arg1, const INumericExp* arg2)
        : NumericCompExp<std::less_equal<double> >(s_op, arg1, arg2)
    {
      INITIALIZE_HASH_CODE();
    }

  protected:
    virtual size_t _calculateHashCode() const
    {
      return CALCULATE_HASH_CODE(NumericCompExp)
           + 8841113;
    }

    virtual const IExp* _internalApply(const Bindings* bindings) const;

  private:
    static std::string s_op;
  };
}

#endif