Ignore:
Timestamp:
04/26/15 00:59:09 (9 years ago)
Author:
Maciej Komosinski
Message:

Renamed logging functions to more intuitive and simple names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/genman.cpp

    r372 r375  
    66#include <frams/vm/classes/genoobj.h>
    77#include GEN_CONFIG_FILE //configuration of active genetic operators
    8 #include "common/hmessage.h"
     8#include "common/log.h"
    99#include "common/nonstd_math.h"
    1010#include "common/stl-util.h"
    11 #include <frams/mhandlers/mhandlers.h>
     11#include <frams/loggers/loggers.h>
    1212
    1313
     
    267267                if (gf->mutate(gn, chg, method) == GENOPER_OK)
    268268                {
    269                         MessageHandlerToMemory eh(MessageHandlerBase::Enable | MessageHandlerToMemory::StoreFirstMessage); //mute testValidity()
     269                        LoggerToMemory eh(LoggerBase::Enable | LoggerToMemory::StoreFirstMessage); //mute testValidity()
    270270                        Geno G(gn, gv.getFormat(), "", "");
    271271                        canvalidate = true;
     
    284284                if (!ok && (count - pcount > 100))
    285285                {
    286                         Hprintf("GenMan", "Mutate", 2, "Tried 100x and failed: %s", g.getGene().c_str());
     286                        logPrintf("GenMan", "Mutate", 2, "Tried 100x and failed: %s", g.getGene().c_str());
    287287                        return Geno("", -1, "", "GENOPER_OPFAIL: Mutate() tried 100x and failed");
    288288                }
     
    308308
    309309        {
    310                 MessageHandlerToMemory eh(MessageHandlerBase::Enable | MessageHandlerToMemory::StoreFirstMessage); //mute testValidity()
     310                LoggerToMemory eh(LoggerBase::Enable | LoggerToMemory::StoreFirstMessage); //mute testValidity()
    311311                bool canvalidate = true;
    312312                if (testValidity(g1v, canvalidate) > 0 && canvalidate == false)
     
    333333                        if (g1n[0]) { gn = g1n; chg = chg1; }
    334334                        else { gn = g2n; chg = chg2; }
    335                         MessageHandlerToMemory eh(MessageHandlerBase::Enable | MessageHandlerToMemory::StoreFirstMessage); //mute testValidity()
     335                        LoggerToMemory eh(LoggerBase::Enable | LoggerToMemory::StoreFirstMessage); //mute testValidity()
    336336                        Geno G(gn, g1v.getFormat(), "", "");
    337337                        bool canvalidate = true;
     
    351351                if (!ok && (count - pcount > 100))
    352352                {
    353                         Hprintf("GenMan", "CrossOver", 2, "Tried 100x and failed: %s and %s", g1.getGene().c_str(), g2.getGene().c_str());
     353                        logPrintf("GenMan", "CrossOver", 2, "Tried 100x and failed: %s and %s", g1.getGene().c_str(), g2.getGene().c_str());
    354354                        return Geno("", -1, "", "GENOPER_OPFAIL: CrossOver() tried 100x and failed");
    355355                }
     
    500500        l.chg = chg;
    501501        l.fit = 0; //temporarily. Will be set when the genotype dies
    502         //Hprintf("GenMan","saveLink",0,"#%d: [%d] '%s' + '%s' -> '%s'",GenoLinkList.size(),count,parent1.c_str(),parent2.c_str(),child.c_str());
     502        //logPrintf("GenMan","saveLink",0,"#%d: [%d] '%s' + '%s' -> '%s'",GenoLinkList.size(),count,parent1.c_str(),parent2.c_str(),child.c_str());
    503503        GenoLinkList.push_back(l);
    504504}
     
    533533        float f1, f2;
    534534        int m;
    535         Hmessage("GenMan", "Report", "The following genetic operators are available:", 0);
     535        logMessage("GenMan", "Report", 0, "The following genetic operators are available:");
    536536        for (unsigned int i = 0; i < oper_fx_list.size(); i++)
    537537        {
     
    549549                }
    550550                //      if (oper_fx_list[i]->similarity("","")!=GENOPER_NOOPER) l+=" similarity";
    551                 Hprintf("GenMan", "Report", 0, "format f%c (%s):%s",
     551                logPrintf("GenMan", "Report", 0, "format f%c (%s):%s",
    552552                        oper_fx_list[i]->supported_format, oper_fx_list[i]->name.c_str(), l.c_str());
    553553        }
Note: See TracChangeset for help on using the changeset viewer.