Function.h
Go to the documentation of this file.
00001 // written by png shao wei
00002 // Function is for ObservationFunction and RewardFunction
00003 
00004 #ifndef Function_H
00005 #define Function_H
00006 
00007 #include <iostream>
00008 #include <vector>
00009 #include <iterator>
00010 #include <map>
00011 #include <cassert>
00012 #include <cmath>
00013 #include "StateObsAct.h"
00014 #include "SparseTable.h"
00015 #include "SparseEntry.h"
00016 
00017 using namespace std;
00018 
00019 class Function {
00020 
00021     protected:
00022         string vnameCurr;
00023         vector<string> parents;
00024 
00025     public:
00026 
00027         void setVNameCurr(string soa);
00028         string getVNameCurr() const;
00029 
00030         void setParents(vector<string> p);
00031         vector<string> getParents() const;
00032 
00033         vector<vector<double> > getDynamicArray();
00034 
00035         void initSparseTables(map<string, StateObsAct*>* mymap);
00036         void fillTables(map<string, StateObsAct*>& mymap, const vector<string>& insttokens,
00037                 const vector<double>& probttokensdouble);
00038 
00039         void simpleDenseInsert(map<string, StateObsAct*> mymap,
00040                 vector<string> insttokens, string myself, double prob);
00041         void simpleSparseInsert(map<string, StateObsAct*>& mymap,
00042                 const vector<string>& insttokens, const string& myself, double prob);
00043 
00044         double simpleGet(map<string, StateObsAct*> mymap,
00045                 vector<string> insttokens, string myself);
00046 
00047         vector<double> splitTable(const vector<double>& probttokensdouble, int size,
00048                 int position);
00049 
00051         // for sparse
00052         SharedPointer<SparseTable> sparseT;
00053                 Function();
00054         // write sparse
00055         std::ostream& write(std::ostream& out);
00056 
00057         bool checkNoMissingEntries(map<string, StateObsAct*> mymap, string& info);
00058 
00059 };
00060 
00061 #endif


appl
Author(s): petercai
autogenerated on Tue Jan 7 2014 11:02:29