2015-10-23 22:53:36 +03:00
|
|
|
/*
|
|
|
|
* Scores.h
|
|
|
|
*
|
|
|
|
* Created on: 23 Oct 2015
|
|
|
|
* Author: hieu
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2015-10-26 19:32:47 +03:00
|
|
|
#include <iostream>
|
2015-10-24 04:02:50 +03:00
|
|
|
#include <string>
|
2015-10-23 22:53:36 +03:00
|
|
|
#include "TypeDef.h"
|
2015-10-28 19:11:12 +03:00
|
|
|
#include "MemPool.h"
|
2015-10-23 22:53:36 +03:00
|
|
|
|
2015-10-24 04:02:50 +03:00
|
|
|
class FeatureFunction;
|
2015-10-28 19:33:08 +03:00
|
|
|
class FeatureFunctions;
|
2015-10-26 00:20:55 +03:00
|
|
|
class System;
|
2015-10-24 04:02:50 +03:00
|
|
|
|
2015-10-23 22:53:36 +03:00
|
|
|
class Scores {
|
2015-10-26 19:32:47 +03:00
|
|
|
friend std::ostream& operator<<(std::ostream &, const Scores &);
|
2015-10-23 22:53:36 +03:00
|
|
|
public:
|
2015-10-28 19:11:12 +03:00
|
|
|
Scores(MemPool &pool, size_t numScores);
|
|
|
|
Scores(MemPool &pool, size_t numScores, const Scores &origScores);
|
2015-10-24 16:36:30 +03:00
|
|
|
virtual ~Scores();
|
2015-10-23 22:53:36 +03:00
|
|
|
|
2015-10-27 02:24:58 +03:00
|
|
|
SCORE GetTotalScore() const
|
|
|
|
{ return m_total; }
|
|
|
|
|
2015-11-02 17:06:03 +03:00
|
|
|
void Reset(size_t numScores);
|
|
|
|
|
2015-10-29 20:21:54 +03:00
|
|
|
void CreateFromString(const std::string &str,
|
|
|
|
const FeatureFunction &featureFunction,
|
|
|
|
const System &system,
|
|
|
|
bool transformScores);
|
2015-10-24 16:36:30 +03:00
|
|
|
|
2015-10-29 02:26:17 +03:00
|
|
|
void PlusEquals(const System &system,
|
|
|
|
const FeatureFunction &featureFunction,
|
|
|
|
const SCORE &score);
|
2015-10-29 15:47:53 +03:00
|
|
|
|
2015-10-29 02:26:17 +03:00
|
|
|
void PlusEquals(const System &system,
|
|
|
|
const FeatureFunction &featureFunction,
|
|
|
|
const std::vector<SCORE> &scores);
|
2015-10-29 15:47:53 +03:00
|
|
|
|
|
|
|
void PlusEquals(const System &system,
|
|
|
|
const Scores &scores);
|
2015-10-28 19:33:08 +03:00
|
|
|
|
2015-11-04 17:54:20 +03:00
|
|
|
void Assign(const System &system,
|
|
|
|
const FeatureFunction &featureFunction,
|
|
|
|
const SCORE &score);
|
|
|
|
|
|
|
|
void Assign(const System &system,
|
|
|
|
const FeatureFunction &featureFunction,
|
|
|
|
const std::vector<SCORE> &scores);
|
|
|
|
|
2015-10-29 18:29:14 +03:00
|
|
|
void Debug(std::ostream &out, const FeatureFunctions &ffs) const;
|
2015-10-28 19:33:08 +03:00
|
|
|
|
2015-10-23 22:53:36 +03:00
|
|
|
protected:
|
|
|
|
SCORE *m_scores;
|
2015-10-24 16:36:30 +03:00
|
|
|
SCORE m_total;
|
2015-10-23 22:53:36 +03:00
|
|
|
};
|
|
|
|
|