5 if(&rhs ==
this)
return *
this;
6 EMDRect::operator=(rhs);
44 for(EDistributions::const_iterator dl=distlist.begin();
45 dl != distlist.end(); dl++)
47 add(dl->second->copy());
55 if(ed->second)
delete ed->second;
69 else return ed->second;
76 else return ed->second;
96 std::map<float, EMDistribution*>::const_iterator
99 ed->second->m_ShootCount++;
100 PropVec prop = ed->second->getPropVec();
122 float tr = dl->second->ratePropVec(prop);
123 if(dl->second->m_Creator.m_WinnerID) {
124 const std::string& creatorname = dl->second->m_Creator.m_StructName;
125 dword creatorid = dl->second->m_Creator.m_WinnerID;
126 winner->
rateBy(creatorname, creatorid, tr);
134 float tr = dl->second->ratePropVec(prop);
135 if(rate<tr) rate = tr;
146 EDistributions::iterator cd = dl++;
175 if(dl->second->m_Integral > 0.00001) {
192 #define MIN_SCALE 0.0001 197 if(ua-la < 0.00001) ua += 2*
M_PI;
217 if((clampvec-prop).norm2() < 0.0001)
return 1;
226 pv[i] =
fgauss01()*m_Stdev[i] + m_Avg[i];
239 if(stdev[i]>0.0001) m_StdevRate[i] = stdev[i];
240 else m_StdevRate[i] = std::numeric_limits<float>::max();
247 PropVec propPV = m_InputEMD->getPropVec();
264 return m_InputEMD->ratePropVec(tfprop);
285 m_StructName = m ? m->
getName() :
"";
291 m_BestRatings.clear();
297 m_Ratings[creatorname][creatorid] = rating;
298 dword& brid = m_BestRatings[creatorname];
299 if(!brid || m_Ratings[creatorname][brid] < rating) {
301 if(m_BestRating < rating) m_BestRating = rating;
308 const std::map<dword,float>& rl = getRatingList(sname);
309 dword bid = getBestRatingID(sname);
310 return *rl.find(bid);
315 if(!hasConnection(sname))
return -1.f;
316 const std::map<dword,float>& rl = getRatingList(sname);
317 std::map<dword,float>::const_iterator rt = rl.find(wid);
318 if(rt != rl.end())
return rt->second;
325 m_BestRatings.clear();
326 for(Ratings::const_iterator refstruct = m_Ratings.begin();
327 refstruct != m_Ratings.end(); refstruct++)
329 dword& brid = m_BestRatings[refstruct->first];
330 float bestrating = 0.f;
331 for(std::map<dword,float>::const_iterator wr= refstruct->second.begin();
332 wr != refstruct->second.end(); wr++)
334 if(wr->second > bestrating) {
335 bestrating = wr->second;
339 if(m_BestRating < bestrating) m_BestRating = bestrating;
DMatrix< T > inverse(const DMatrix< T > &dmat)
ExpectationMap & operator=(const ExpectationMap &rhs)
float ratePropVec(const PropVec &prop, Winner *winner=NULL) const
void clear(bool oldonly=false)
EDistributions m_Distributions
Model * generateInstance() const
EMDistribution * getEDist(dword wid)
float gauss2(float x2, float stdev)
const std::pair< dword, float > getBest(const std::string &sname) const
static void correctLBUB(PropVec &lb, PropVec &ub)
dword getShootCount() const
PropTF getIdentityPropTF()
VT & clamp(const VT &lb, const VT &ub)
float getPropScale(const PropVec &prop)
float ratePropVec(const PropVec &prop, Winner *winner=NULL) const
virtual EMDistribution * copy() const
void add(EMDistribution *ed)
PropTF getPropTF(const PropVec &from, const PropVec &to)
float mapAngle2PI(float a)
PropVec getPropVec() const
void setStdev(const PropVec &stdev)
PropVec & hgPropTF(const DMatrixf &tfmat, PropVec &prop)
std::map< float, EMDistribution * > m_SortDist
PropVec & setPropDir(PropVec &prop, float dir)
VT & clampUB(const VT &ub)
float getPropDir(const PropVec &prop)
bool hasDist(dword wid) const
float getConnection(const std::string &sname, dword wid) const
PropVec getPropVec() const
void adaptProperties(const PropVec &prop)
PropVec & fwdPropTF(PropVec &from, const PropTF &tf)
VT & clampLB(const VT &lb)
float rateBy(const std::string &creatorname, dword creatorid, float rating)
virtual PropVec getPropVec() const
DMatrix< T > stdev(const DMatrix< T > &mat)
std::map< dword, EMDistribution * > EDistributions
float mapAnglePI(float a)
const std::string & getName() const
PropVec & setPropScale(PropVec &prop, float pscale)
static unsigned int size()
void setRepresentative(const Model &model)
float ratePropVec(const PropVec &prop, Winner *winner=NULL) const