/* 
 * Tactic is the legal property of its developers, whose names are too numerous 
 * to list here.  Please refer to the COPYRIGHT file distributed with this 
 * source distribution. 
 * 
 * This library is free software; you can redistribute it and/or 
 * modify it under the terms of the GNU Lesser General Public 
 * License as published by the Free Software Foundation; either 
 * version 2.1 of the License, or (at your option) any later version. 
 * 
 * This library is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
 * Lesser General Public License for more details. 
 * 
 * You should have received a copy of the GNU Lesser General Public 
 * License along with this library; if not, write to the Free Software 
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
 *
 * See README for more informations
 *
 * FuzzyNumber.h
 *
 * Abstract class which gives information for different FuzzyValues. Each type of FuzzyNumber
 * are linked with specified FuzzyValues.
 *
 * Date 18/03/06
 *
 */

#ifndef FUZZY_NUMBER_H
#define FUZZY_NUMBER_H

#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include "FuzzyNumberName.h"
#include "FuzzyValue.h"

class FuzzyNumber{

protected :

	FuzzyNumberName name;				// Name of the fuzzy number
	float value;						// Value of the fuzzy number
	std::vector<FuzzyValue*> vectFV;	// vector of all FuzzyValue linked with this FuzzyNumber

public :
	
	/**
	 *Constructor : Create a FuzzyNumber
	 * 
	 *@param void
	 *
	 */
	FuzzyNumber(void);

	/**
	 *Destructor : Destroy the FuzzyNumber
	 * 
	 *@param void
	 *
	 */
	~FuzzyNumber(void);

	/**
	 *addFV : add a FuzzyValue
	 * 
	 *@param fv : the FuzzyValue to add
	 *
	 *@return void
	 *
	 */
	virtual void addFV(FuzzyValue* fv);

	/**
	 *getName : return the attribute name
	 * 
	 *@param void
	 *
	 *@return float : the value of the FuzzyNumber
	 *
	 */
	FuzzyNumberName getName(void);

	/**
	 *getValue : return the attribute value
	 * 
	 *@param void
	 *
	 *@return float : the value of the FuzzyNumber
	 *
	 */
	float getValue(void);

	/**
	 *setVect : set vectFV
	 * 
	 *@param ptVect : vector of FuzzyValue to link with the FuzzyNumber
	 *
	 *@return void
	 *
	 */
	void setVect(std::vector<FuzzyValue*> vect);

	/**
	 *update : refresh the value of the FuzzyNumber
	 * 
	 *@param void
	 *
	 *@return void
	 *
	 */
	virtual void update(void);

protected :

	/**
	 *notify : update all the FuzzyValues linked with this FuzzyNumber
	 * 
	 *@param void
	 *
	 *@return void
	 *
	 */
	void notify(void);

public :

	/**
	 *toString : return the string which represent the FuzzyNumber
	 * 
	 *@param void
	 *
	 *@return std::string
	 *
	 */
	virtual std::string toString(void);

};

#endif