Ignore:
Timestamp:
06/29/09 22:12:09 (15 years ago)
Author:
mwajcht
Message:

Added some comments to converter classes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/f8-to-f1/conv_f8tof1.cpp

    r25 r26  
    366366        SString s = SString::valueOf(params[0]);
    367367#if CONV_DEBUG > 1
    368         cout << "@@@@@ Wartosc parametru: " << this->paramName << ": " << params[0] << endl;
     368        cout << "@@@@@ Param value: " << this->paramName << ": " << params[0] << endl;
    369369#endif
    370370        return s;
     
    414414}
    415415
    416 /**
    417  * Zwracamy puste, bo co innego mamy zrobić?
    418  */
    419416const SString Production::getF1Genotype(const vector<double> params) {
    420         return SString("");
     417        return SString(); //return empty
    421418}
    422419
     
    430427        }
    431428       
    432         //jedziemy po podprodukcjach
     429        //iterate through subproductions
    433430        for (vector<SubProduction>::iterator subProdIter = this->subproductions.begin();
    434431                 subProdIter != this->subproductions.end(); subProdIter++) {
     
    438435                SubProduction &sp = *subProdIter;
    439436                bool conditionsOK = true;
    440                 //sprawdzenie warunków dla danej podprodukcji
     437                //check conditions of subproduction
    441438                for (vector<Condition>::iterator condIter = sp.conditions.begin();
    442439                         condIter != sp.conditions.end(); condIter++) {
    443440                        if (conditionsOK == false) {
    444                                 break; //bo dalsze sprawdzanie i tak nie ma sensu
     441                                break; //because it's no use checking further
    445442                        }
    446443                        Condition &c = *condIter;
     
    479476                }
    480477                if (conditionsOK) {
    481                         //jedziemy po każdej akcji w danej podprodukcji
     478                        //iterate through each action in subproduction
    482479                        for (int i = 0; i < sp.actions.size(); i++) {
    483480#if CONV_DEBUG > 1
     
    487484                                vector<SString> strParams = sp.actions[i].params;
    488485                                vector<double> params;
    489                                 //podmieniamy nazwy parametrów na ich wartości
     486                                //replace parameter names with values
    490487                                for (vector<SString>::iterator paramIter = strParams.begin();
    491488                                         paramIter != strParams.end(); paramIter++) {
     
    527524        while (in.getNextToken(pos, line, '\n')) {
    528525#if CONV_DEBUG > 1
    529                 std::cout << "### Linia: " << line << std::endl;
     526                std::cout << "### Line: " << line << std::endl;
    530527#endif
    531528                if (line.startsWith("P") && line.indexOf('(', 0) == -1) {
     
    540537                        SString prodName = line.substr(0, lParenIndex);
    541538#if CONV_DEBUG > 1
    542                         std::cout << "###Produkcja: " << prodName << std::endl;
     539                        std::cout << "###Production: " << prodName << std::endl;
    543540#endif
    544541                        names.push_back(prodName);
     
    599596       
    600597        //cout << "convert() 1" << endl;
    601         //ustawienie zmiennych dla początkowej produkcji
     598        //set parameters for start production
    602599        Production *firstProduction = lsystem->productions[lsystem->firstProductionName];
    603600        vector<double> params;
     
    674671        Lsystem *lsys = new Lsystem();
    675672       
    676         //wczytujemy nazwy produkcji i tworzymy wstępnie dla nich obiekty
     673        //read production names and create objects for them
    677674        vector<SString> names = this->readProductionNames(in);
    678675        for (vector<SString>::iterator nameIter = names.begin(); nameIter != names.end(); nameIter++) {
     
    699696#if CONV_DEBUG > 1
    700697       
    701         cout << "@@@@@ Przeparsowane" << endl;
     698        cout << "@@@@@ Parsed" << endl;
    702699       
    703700        cout << "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&" << endl;
     
    726723
    727724bool GenoConv_F8ToF1::parseInput(const char* src, Lsystem* lsys) {
    728         //inicjalizacja zmiennych parsera
     725        //initialize parser
    729726        int yv;
    730727        istringstream input;
     
    739736        extern YYSTYPE yylval;
    740737       
    741         //parsowanie wejścia
     738        //parse input
    742739        // on EOF yylex will return 0
    743740        while((yv = scanner.yylex()) != 0) {
Note: See TracChangeset for help on using the changeset viewer.