/// @file samplemodeler.cpp
/// A sample modeler which basically assigns fixed equal probabilities to every symbol.
///
/// @author mouser
/// @date   2003.07.29
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
#include "samplemodeler.hpp"
//---------------------------------------------------------------------------



//---------------------------------------------------------------------------
// MODELLER PUBLIC API
bool SampleModeler::CreateModelUsingParser(OctaneParser *parserp)
	{
	// initialize vector with proper number of symbols as specified by the parser
	int symbolcount=parserp->GetSymbolCount();
	weightvector.SetSymbolCount(symbolcount);

	// set them all equal
	for (int index=0;index<symbolcount;++index)
		weightvector.SetSymbolWeight(index,1);

	// normalize to probability distribution
	weightvector.NormalizeToProbabilityDistribution();

	// success
	return true;
	}
//---------------------------------------------------------------------------
