#include #include #include #include "myitem.h" #include "mylist.h" #include "suit.h" #include "chrome.h" #include "pch.h" SUIT_object best, progdisp1, progdisp2,progdisp3,progdisp4,progdisp5, progdisp6; void CreateBoundedValues(); void sendThemAllBack(); int mainqueue(Pop*); //Declare a prototype for mainqueue void ShowCurrentParams(); void UseDefaultParams(SUIT_object); void Do_intervals(list *); int Do_specifics(list *); double increment = 0.0; int whichtree; double x = 0.0; char* filename = "NULL"; char* paramfile = "NULL"; //Global variable holds the filename char* zoomval = "NULL"; int current_pop = 0; float max_fitness = 0.0; Pop* pop1; list * genbreak = new list(); //Pointer to the population ChromeParams *ThisParams = new ChromeParams(); /* allow scrollbars to move pictures in widgets via scrollbars */ void changewindow(SUIT_object ob) { whichtree = 0; if ( (ob == SUIT_name("h1")) || (ob == SUIT_name("v1"))) whichtree = 1; if ( (ob == SUIT_name("h2")) || (ob == SUIT_name("v2"))) whichtree = 2; if ( (ob == SUIT_name("h3")) || (ob == SUIT_name("v3"))) whichtree = 3; if ( (ob == SUIT_name("h4")) || (ob == SUIT_name("v4"))) whichtree = 4; if ( (ob == SUIT_name("h5")) || (ob == SUIT_name("v5"))) whichtree = 5; if ( (ob == SUIT_name("h6")) || (ob == SUIT_name("v6"))) whichtree = 6; pop1->pop[current_pop]->tree_display(whichtree); } /*Run the queue program*/ void begintings(SUIT_object progdisp) { SUIT_setBoolean(SUIT_name("delete population"),DISABLED,FALSE); SUIT_setBoolean(SUIT_name("perform generations"),DISABLED,FALSE); SUIT_setBoolean(SUIT_name("Display_Stats"),DISABLED,FALSE); if (ThisParams->params[pPopSize] == 0) { UseDefaultParams(progdisp); } genbreak->resetlist(); pop1 = (Pop *) mainqueue(pop1); SUIT_setBoolean(progdisp,DISABLED,TRUE); pop1->pop[current_pop]->tree_display(whichtree); } void update_results() { x = pop1->UpdateInterface(max_fitness, increment,x); //cout << "x" << x << " incrment" << increment<params[pGenerateLimit]); //cout << "denominator" << denominator; increment = (double)1/(double)denominator; int update_count = 0; int number_of_generations; if (!(genbreak->listEmpty())) { int previousbreak = ((breakpoint *) genbreak->currentbreakpoint())->getbreakpoint(); if (previousbreak < (ThisParams->params[pGenerateLimit])) { genbreak->nextbreakpoint(); int nextbreak = ((breakpoint *) genbreak->currentbreakpoint())->getbreakpoint(); number_of_generations = nextbreak - previousbreak; if (nextbreak > (ThisParams->params[pGenerateLimit])) { number_of_generations = (ThisParams->params[pGenerateLimit]) - previousbreak; } for(int i = 0; i< number_of_generations;i++) { update_count++; char *whichpop = new char[100]; pop1->go_until(0,ThisParams->params[pPopSize],max_fitness,-1); sprintf(whichpop,"%d", (previousbreak+i+1)); SUIT_setText(SUIT_name("whichgen"),LABEL,whichpop); ////cout << pop1->BestFitness->fvalue << endl; delete whichpop; if (update_count == 1) { update_results(); update_count = 0; } } } } else { SUIT_inform("Running all generations"); for (int j = 0; jparams[pGenerateLimit];j++) { update_count++; pop1->go_until(0,ThisParams->params[pPopSize],max_fitness,-1); char *whichpopagain = new char[100]; sprintf(whichpopagain,"%d", (j+1)); SUIT_setText(SUIT_name("whichgen"),LABEL,whichpopagain); delete whichpopagain; if (update_count == 1) { update_results(); update_count = 0; } } } pop1->pop[current_pop]->tree_display(whichtree); } /* function to let user save a selected expression*/ void SaveFile (SUIT_object obj) { switch (SUIT_askOKCancel("EXAMPLE MESSAGE: Confirm -- About to save !.")) { case REPLY_OK: printf("User selected OK\n"); break; case REPLY_CANCEL: printf("User selected CANCEL\n"); break; case REPLY_BUTTON2: break; case REPLY_BUTTON1: break; } } /* let the user select the name of file before saving */ void SaveAs (SUIT_object obj) { SUIT_object dbox; dbox = SUIT_createFileBrowserDialogBox("fred", NULL, "Save As", "save file as :"); if (SUIT_activateDialogBox (dbox) == REPLY_OK) { char * savefile = SUIT_getText(dbox,CURRENT_VALUE); ofstream out (savefile); pop1->pop[current_pop]->write(0,out); } else cout << "User pressed cancel\n"; SUIT_destroyObject(dbox); } /* load a program from a file */ void PopUpFileBox (SUIT_object obj) { SUIT_object dbox; dbox = SUIT_createFileBrowserDialogBox("fred", NULL, "Open file", "Open file named:"); if (SUIT_activateDialogBox(dbox) == REPLY_OK) { filename = SUIT_getText(dbox,CURRENT_VALUE); ifstream gpLoad (filename); int rval = pop1->pop[current_pop]->Load(gpLoad,TRUE); gpLoad.close(); if (rval != 0) { SUIT_inform("Load error for file"); } } else SUIT_destroyObject(dbox); } boolean displayrect; boolean displaytext; boolean showeval; /* create a new widget of type CreateDisplayWidget */ void redisplay(); void createfilebar(); int getdisp(SUIT_object me) { if (me == SUIT_name("disp1")) return 1; if (me == SUIT_name("disp2")) return 2; if (me == SUIT_name("disp3")) return 3; if (me == SUIT_name("disp4")) return 4; if (me == SUIT_name("disp5")) return 5; if (me == SUIT_name("disp6")) return 6; return 0; } void CentreMe(SUIT_object me, SUIT_event myevent) { /* put widget in centre */ sendThemAllBack(); SUIT_setViewport(SUIT_getParent(me),VIEWPORT,SUIT_defViewport(0,30,750,640)); SUIT_bringToFront(SUIT_getParent(me)); redisplay(); whichtree = getdisp(SUIT_getParent(me)); pop1->pop[current_pop]->tree_display(whichtree); } void PaintCentreMeWidget(SUIT_object cm) { GP_rectangleCoord(0.05,0.05,0.2,0.3); GP_setColor(GP_defColor("midnight blue",TRUE)); GP_fillRectangleCoord(0.3,0.3,0.85,0.85); } SUIT_object CreateCentreMeWidget(char * name) { SUIT_object centreme; centreme = SUIT_createObject(name, "centre widget class"); SUIT_addDisplayToObject(centreme, "standard",CentreMe,PaintCentreMeWidget); SUIT_registerClass("centre widget class",CreateCentreMeWidget,"centres them"); return (centreme); } void ReturnMe(SUIT_object me, SUIT_event myevent) { sendThemAllBack(); redisplay(); whichtree = 0; pop1->pop[current_pop]->tree_display(whichtree); } void PaintReturnMeWidget(SUIT_object rm) { GP_setColor(GP_defColor("midnight blue",TRUE)); GP_fillRectangleCoord(0.05,0.05,0.2,0.3); GP_rectangleCoord(0.3,0.3,0.85,0.85); } SUIT_object CreateReturnMeWidget(char * name) { SUIT_object returnme; returnme = SUIT_createObject(name,"return widget class"); SUIT_addDisplayToObject(returnme, "standard",ReturnMe,PaintReturnMeWidget); SUIT_registerClass("return widget class",CreateReturnMeWidget,"returns them"); return (returnme); } void redisplay() { SUIT_redisplayRequired(SUIT_name("disp1")); SUIT_redisplayRequired(SUIT_name("disp2")); SUIT_redisplayRequired(SUIT_name("disp3")); SUIT_redisplayRequired(SUIT_name("disp4")); SUIT_redisplayRequired(SUIT_name("disp5")); SUIT_redisplayRequired(SUIT_name("disp6")); SUIT_performRedisplay(); } /* send widgets to original position */ void sendThemAllBack() { SUIT_setViewport(SUIT_name("disp1"),VIEWPORT,SUIT_defViewport(0,40,250,340)); SUIT_setText(SUIT_name("zl1"),LABEL,"100"); SUIT_setViewport(SUIT_name("disp2"),VIEWPORT,SUIT_defViewport(250,40,500,340)); SUIT_setText(SUIT_name("zl2"),LABEL,"100"); SUIT_setViewport(SUIT_name("disp3"),VIEWPORT,SUIT_defViewport(500,40,750,340)); SUIT_setText(SUIT_name("zl3"),LABEL,"100"); SUIT_setViewport(SUIT_name("disp4"),VIEWPORT,SUIT_defViewport(0,340,250,640)); SUIT_setText(SUIT_name("zl4"),LABEL,"100"); SUIT_setViewport(SUIT_name("disp5"),VIEWPORT,SUIT_defViewport(250,340,500,640)); SUIT_setText(SUIT_name("zl5"),LABEL,"100"); SUIT_setViewport(SUIT_name("disp6"),VIEWPORT,SUIT_defViewport(500,340,750,640)); SUIT_setText(SUIT_name("zl6"),LABEL,"100"); } /* create widgets of class expr display chip */ void CreateChips() { progdisp1 = SUIT_createBulletinBoard("disp1"); SUIT_setViewport(progdisp1,VIEWPORT,SUIT_defViewport(0,40,250,340)); progdisp2 = SUIT_createBulletinBoard("disp2"); SUIT_setViewport(progdisp2,VIEWPORT,SUIT_defViewport(250,40,500,340)); progdisp3 = SUIT_createBulletinBoard("disp3"); SUIT_setViewport(progdisp3,VIEWPORT,SUIT_defViewport(500,40,750,340)); progdisp4 = SUIT_createBulletinBoard("disp4"); SUIT_setViewport(progdisp4,VIEWPORT,SUIT_defViewport(0,340,250,640)); progdisp5 = SUIT_createBulletinBoard("disp5"); SUIT_setViewport(progdisp5,VIEWPORT,SUIT_defViewport(250,340,500,640)); progdisp6 = SUIT_createBulletinBoard("disp6"); SUIT_setViewport(progdisp6,VIEWPORT,SUIT_defViewport(500,340,750,640)); } /* create children for display chips */ void CreateBoundedValues() { SUIT_object sh1,sv1,sh2,sv2,sh3,sv3,sh4,sv4,sh5,sv5,sh6,sv6; sh1 = SUIT_createBoundedValue("h1",changewindow); sv1 = SUIT_createBoundedValue("v1",changewindow); sh2 = SUIT_createBoundedValue("h2",changewindow); sv2 = SUIT_createBoundedValue("v2",changewindow); sh3 = SUIT_createBoundedValue("h3",changewindow); sv3 = SUIT_createBoundedValue("v3",changewindow); sh4 = SUIT_createBoundedValue("h4",changewindow); sv4 = SUIT_createBoundedValue("v4",changewindow); sh5 = SUIT_createBoundedValue("h5",changewindow); sv5 = SUIT_createBoundedValue("v5",changewindow); sh6 = SUIT_createBoundedValue("h6",changewindow); sv6 = SUIT_createBoundedValue("v6",changewindow); } /* Dialog box for getting the zoom value */ void SetIsText(SUIT_object it) { displaytext = SUIT_getBoolean(it,CURRENT_VALUE); SUIT_setBoolean(SUIT_name("Display_Evaluation"),CURRENT_VALUE,!displaytext); showeval = !displaytext; pop1->pop[current_pop]->tree_display(whichtree); } void SetIsRectangle(SUIT_object ir) { displayrect = SUIT_getBoolean(ir,CURRENT_VALUE); } void SetShowEval(SUIT_object se) { showeval = SUIT_getBoolean(se,CURRENT_VALUE); SUIT_setBoolean(SUIT_name("Display_Text"),CURRENT_VALUE,!showeval); displaytext = !showeval; pop1->pop[current_pop]->tree_display(whichtree); } void CreateTreeDisplayParams() { SUIT_object istext, isrectangle, displayeval; istext = SUIT_createOnOffSwitch("Display_text",SetIsText); isrectangle = SUIT_createOnOffSwitch("Display_rect",SetIsRectangle); displayeval = SUIT_createOnOffSwitch("Display_Evaluation",SetShowEval); } void popsize(SUIT_object pboard) { SUIT_object popsize = SUIT_createTypeInBox("popsize",NULL); SUIT_object popsizelabel = SUIT_createLabel("pop size"); SUIT_addChildToObject(pboard,popsizelabel); SUIT_addChildToObject(pboard,popsize); SUIT_setViewport(popsize,VIEWPORT,SUIT_mapToParent(popsize,0.1,0.01,0.2,0.1)); SUIT_setViewport(popsizelabel,VIEWPORT,SUIT_mapToParent(popsizelabel,0.1,0.101,0.2,0.109)); } void setpopsize() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pPopSize]); SUIT_setText(SUIT_name("popsize"),CURRENT_VALUE,buffer); } void genlimit(SUIT_object pboard) { SUIT_object genlimit = SUIT_createTypeInBox("genlimit",NULL); SUIT_object genlimitlabel = SUIT_createLabel("gen limit"); SUIT_addChildToObject(pboard,genlimitlabel); SUIT_addChildToObject(pboard,genlimit); SUIT_setViewport(genlimit,VIEWPORT,SUIT_mapToParent(genlimit,0.1,0.11,0.2,0.2)); SUIT_setViewport(genlimitlabel,VIEWPORT,SUIT_mapToParent(genlimitlabel,0.1,0.201,0.2,0.209)); } void setgenlimit() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pGenerateLimit]); SUIT_setText(SUIT_name("genlimit"),CURRENT_VALUE,buffer); } void maxexpr(SUIT_object pboard) { SUIT_object maxexpr = SUIT_createTypeInBox("maxexpr",NULL); SUIT_addChildToObject(pboard,maxexpr); SUIT_setViewport(maxexpr,VIEWPORT,SUIT_mapToParent(maxexpr,0.1,0.21,0.2,0.3)); SUIT_object maxexprlabel = SUIT_createLabel("max expr"); SUIT_addChildToObject(pboard,maxexprlabel); SUIT_setViewport(maxexprlabel,VIEWPORT,SUIT_mapToParent(maxexprlabel,0.1,0.301,0.2,0.309)); } void setmaxexpr() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pMaxExpr]); SUIT_setText(SUIT_name("maxexpr"),CURRENT_VALUE,buffer); } void muterate(SUIT_object pboard) { SUIT_object muterate = SUIT_createTypeInBox("muterate",NULL); SUIT_addChildToObject(pboard,muterate); SUIT_setViewport(muterate,VIEWPORT,SUIT_mapToParent(muterate,0.1,0.31,0.2,0.4)); SUIT_object muteratelabel = SUIT_createLabel("mute rate"); SUIT_addChildToObject(pboard,muteratelabel); SUIT_setViewport(muteratelabel,VIEWPORT,SUIT_mapToParent(muteratelabel,0.1,0.401,0.2,0.409)); } void setmuterate() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pMuteRate]); SUIT_setText(SUIT_name("muterate"),CURRENT_VALUE,buffer); } void crosself(SUIT_object pboard) { SUIT_object crosself = SUIT_createTypeInBox("crosself",NULL); SUIT_addChildToObject(pboard,crosself); SUIT_setViewport(crosself,VIEWPORT,SUIT_mapToParent(crosself,0.1,0.41,0.2,0.5)); SUIT_object crosselflabel = SUIT_createLabel("cross self"); SUIT_addChildToObject(pboard,crosselflabel); SUIT_setViewport(crosselflabel,VIEWPORT,SUIT_mapToParent(crosselflabel,0.1,0.501,0.2,0.509)); } void setcrosself() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pCrossSelf]); SUIT_setText(SUIT_name("crosself"),CURRENT_VALUE,buffer); } void unrestrictwt(SUIT_object pboard) { SUIT_object unrestrictwt = SUIT_createTypeInBox("unrestrictwt",NULL); SUIT_addChildToObject(pboard,unrestrictwt); SUIT_setViewport(unrestrictwt,VIEWPORT,SUIT_mapToParent(unrestrictwt,0.1,0.51,0.2,0.6)); SUIT_object unrestrictwtlabel = SUIT_createLabel("unrestrict wt"); SUIT_addChildToObject(pboard,unrestrictwtlabel); SUIT_setViewport(unrestrictwtlabel,VIEWPORT,SUIT_mapToParent(unrestrictwtlabel,0.1,0.601,0.2,0.609)); } void setunrestrictwt() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pUnRestrictWt]); SUIT_setText(SUIT_name("unrestrictwt"),CURRENT_VALUE,buffer); } void crosswt(SUIT_object pboard) { SUIT_object crosswt = SUIT_createTypeInBox("crosswt",NULL); SUIT_addChildToObject(pboard,crosswt); SUIT_setViewport(crosswt,VIEWPORT,SUIT_mapToParent(crosswt,0.1,0.61,0.2,0.7)); SUIT_object crosswtlabel = SUIT_createLabel("cross wt"); SUIT_addChildToObject(pboard,crosswtlabel); SUIT_setViewport(crosswtlabel,VIEWPORT,SUIT_mapToParent(crosswtlabel,0.1,0.701,0.2,0.709)); } void setcrosswt() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pCrossWt]); SUIT_setText(SUIT_name("crosswt"),CURRENT_VALUE,buffer); } void mutewt(SUIT_object pboard) { SUIT_object mutewt = SUIT_createTypeInBox("mutewt",NULL); SUIT_addChildToObject(pboard,mutewt); SUIT_setViewport(mutewt,VIEWPORT,SUIT_mapToParent(mutewt,0.1,0.71,0.2,0.8)); SUIT_object mutewtlabel = SUIT_createLabel("mute wt"); SUIT_addChildToObject(pboard,mutewtlabel); SUIT_setViewport(mutewtlabel,VIEWPORT,SUIT_mapToParent(mutewtlabel,0.1,0.801,0.2,0.809)); } void setmutewt() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pMuteWt]); SUIT_setText(SUIT_name("mutewt"),CURRENT_VALUE,buffer); } void annealxwt(SUIT_object pboard) { SUIT_object annealxwt = SUIT_createTypeInBox("annealxwt",NULL); SUIT_addChildToObject(pboard,annealxwt); SUIT_setViewport(annealxwt,VIEWPORT,SUIT_mapToParent(annealxwt,0.1,0.81,0.2,0.9)); SUIT_object annealxwtlabel = SUIT_createLabel("anneal cross wt"); SUIT_addChildToObject(pboard,annealxwtlabel); SUIT_setViewport(annealxwtlabel,VIEWPORT,SUIT_mapToParent(annealxwtlabel,0.1,0.901,0.2,0.909)); } void setannealxwt() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pAnnealCrossWt]); SUIT_setText(SUIT_name("annealxwt"),CURRENT_VALUE,buffer); } void annealmtwt(SUIT_object pboard) { SUIT_object annealmtwt = SUIT_createTypeInBox("annealmtwt",NULL); SUIT_addChildToObject(pboard,annealmtwt); SUIT_setViewport(annealmtwt,VIEWPORT,SUIT_mapToParent(annealmtwt,0.25,0.01,0.35,0.1)); SUIT_object annealmtwtlabel = SUIT_createLabel("anneal mute wt"); SUIT_addChildToObject(pboard,annealmtwtlabel); SUIT_setViewport(annealmtwtlabel,VIEWPORT,SUIT_mapToParent(annealmtwtlabel,0.25,0.101,0.35,0.109)); } void setannealmtwt() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pAnnealMuteWt]); SUIT_setText(SUIT_name("annealmtwt"),CURRENT_VALUE,buffer); } void copywt(SUIT_object pboard) { SUIT_object copywt = SUIT_createTypeInBox("copywt",NULL); SUIT_addChildToObject(pboard,copywt); SUIT_setViewport(copywt,VIEWPORT,SUIT_mapToParent(copywt,0.25,0.11,0.35,0.2)); SUIT_object copywtlabel = SUIT_createLabel("copy wt"); SUIT_addChildToObject(pboard,copywtlabel); SUIT_setViewport(copywtlabel,VIEWPORT,SUIT_mapToParent(copywtlabel,0.25,0.201,0.35,0.209)); } void setcopywt() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pCopyWt]); SUIT_setText(SUIT_name("copywt"),CURRENT_VALUE,buffer); } void mutenodewt(SUIT_object pboard) { SUIT_object mutenodewt = SUIT_createTypeInBox("mutenodewt",NULL); SUIT_addChildToObject(pboard,mutenodewt); SUIT_setViewport(mutenodewt,VIEWPORT,SUIT_mapToParent(mutenodewt,0.25,0.21,0.35,0.3)); SUIT_object mutenodewtlabel = SUIT_createLabel("mutenode wt"); SUIT_addChildToObject(pboard,mutenodewtlabel); SUIT_setViewport(mutenodewtlabel,VIEWPORT,SUIT_mapToParent(mutenodewtlabel,0.25,0.301,0.35,0.309)); } void setmutenodewt() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pMuteNodeWt]); SUIT_setText(SUIT_name("mutenodewt"),CURRENT_VALUE,buffer); } void muteconstwt(SUIT_object pboard) { SUIT_object muteconstwt = SUIT_createTypeInBox("muteconstwt",NULL); SUIT_addChildToObject(pboard,muteconstwt); SUIT_setViewport(muteconstwt,VIEWPORT,SUIT_mapToParent(muteconstwt,0.25,0.31,0.35,0.4)); SUIT_object muteconstwtlabel = SUIT_createLabel("muteconst wt"); SUIT_addChildToObject(pboard,muteconstwtlabel); SUIT_setViewport(muteconstwtlabel,VIEWPORT,SUIT_mapToParent(muteconstwtlabel,0.25,0.401,0.35,0.409)); } void setmuteconstwt() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pMuteConstWt]); SUIT_setText(SUIT_name("muteconstwt"),CURRENT_VALUE,buffer); } void muteshrinkwt(SUIT_object pboard) { SUIT_object muteshrinkwt = SUIT_createTypeInBox("muteshrinkwt",NULL); SUIT_addChildToObject(pboard,muteshrinkwt); SUIT_setViewport(muteshrinkwt,VIEWPORT,SUIT_mapToParent(muteshrinkwt,0.25,0.41,0.35,0.5)); SUIT_object muteshrinkwtlabel = SUIT_createLabel("muteshrink wt"); SUIT_addChildToObject(pboard,muteshrinkwtlabel); SUIT_setViewport(muteshrinkwtlabel,VIEWPORT,SUIT_mapToParent(muteshrinkwtlabel,0.25,0.501,0.35,0.509)); } void setmuteshrinkwt() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pMuteShrinkWt]); SUIT_setText(SUIT_name("muteshrinkwt"),CURRENT_VALUE,buffer); } void tournsize(SUIT_object pboard) { SUIT_object tournsize = SUIT_createTypeInBox("tournsize",NULL); SUIT_addChildToObject(pboard,tournsize); SUIT_setViewport(tournsize,VIEWPORT,SUIT_mapToParent(tournsize,0.25,0.61,0.35,0.7)); SUIT_object tournsizelabel = SUIT_createLabel("tourn size"); SUIT_addChildToObject(pboard,tournsizelabel); SUIT_setViewport(tournsizelabel,VIEWPORT,SUIT_mapToParent(tournsizelabel,0.25,0.701,0.35,0.709)); } void settournsize() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pTournSize]); SUIT_setText(SUIT_name("tournsize"),CURRENT_VALUE,buffer); } void materadius(SUIT_object pboard) { SUIT_object materadius = SUIT_createTypeInBox("materadius",NULL); SUIT_addChildToObject(pboard,materadius); SUIT_setViewport(materadius,VIEWPORT,SUIT_mapToParent(materadius,0.25,0.71,0.35,0.8)); SUIT_object materadiuslabel = SUIT_createLabel("mate radius"); SUIT_addChildToObject(pboard,materadiuslabel); SUIT_setViewport(materadiuslabel,VIEWPORT,SUIT_mapToParent(materadiuslabel,0.25,0.801,0.35,0.809)); } void setmateradius() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pMateRadius]); SUIT_setText(SUIT_name("materadius"),CURRENT_VALUE,buffer); } void gaussregion(SUIT_object pboard) { SUIT_object gaussregion = SUIT_createTypeInBox("gaussregion",NULL); SUIT_addChildToObject(pboard,gaussregion); SUIT_setViewport(gaussregion,VIEWPORT,SUIT_mapToParent(gaussregion,0.25,0.81,0.35,0.9)); SUIT_object gaussregionlabel = SUIT_createLabel("gauss region"); SUIT_addChildToObject(pboard,gaussregionlabel); SUIT_setViewport(gaussregionlabel,VIEWPORT,SUIT_mapToParent(gaussregionlabel,0.25,0.901,0.35,0.909)); } void setgaussregion() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pGaussRegion]); SUIT_setText(SUIT_name("gaussregion"),CURRENT_VALUE,buffer); } void selectmethod(SUIT_object pboard) { SUIT_object selectmethod = SUIT_createTypeInBox("selectmethod",NULL); SUIT_addChildToObject(pboard,selectmethod); SUIT_setViewport(selectmethod,VIEWPORT,SUIT_mapToParent(selectmethod,0.25,0.51,0.35,0.6)); SUIT_object selectmethodlabel = SUIT_createLabel("select method"); SUIT_addChildToObject(pboard,selectmethodlabel); SUIT_setViewport(selectmethodlabel,VIEWPORT,SUIT_mapToParent(selectmethodlabel,0.25,0.601,0.35,0.609)); } void setselectmethod() { char buffer[100]; sprintf(buffer,"%d",ThisParams->params[pSelectMethod]); SUIT_setText(SUIT_name("selectmethod"),CURRENT_VALUE,buffer); } void repeateval(SUIT_object pboard) { SUIT_object repeateval = SUIT_createTypeInBox("repeateval",NULL); SUIT_addChildToObject(pboard,repeateval); SUIT_setViewport(repeateval,VIEWPORT,SUIT_mapToParent(repeateval,0.4,0.81,0.5,0.9)); SUIT_object repeatevallabel = SUIT_createLabel("repeat evaluation"); SUIT_addChildToObject(pboard,repeatevallabel); SUIT_setViewport(repeatevallabel,VIEWPORT,SUIT_mapToParent(repeatevallabel,0.4,0.901,0.5,0.909)); } void setrepeateval() { char buffer[100]; sprintf(buffer,"%d",ThisParams->params[pRepeatEval]); SUIT_setText(SUIT_name("repeateval"),CURRENT_VALUE,buffer); } void killtourn(SUIT_object pboard) { SUIT_object killtourn = SUIT_createTypeInBox("killtourn",NULL); SUIT_addChildToObject(pboard,killtourn); SUIT_setViewport(killtourn,VIEWPORT,SUIT_mapToParent(killtourn,0.4,0.71,0.5,0.8)); SUIT_object killtournlabel = SUIT_createLabel("kill tourn"); SUIT_addChildToObject(pboard,killtournlabel); SUIT_setViewport(killtournlabel,VIEWPORT,SUIT_mapToParent(killtournlabel,0.4,0.801,0.5,0.809)); } void setkilltourn() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pKillTourn]); SUIT_setText(SUIT_name("killtourn"),CURRENT_VALUE,buffer); } void maxage(SUIT_object pboard) { SUIT_object maxage = SUIT_createTypeInBox("maxage",NULL); SUIT_addChildToObject(pboard,maxage); SUIT_setViewport(maxage,VIEWPORT,SUIT_mapToParent(maxage,0.4,0.61,0.5,0.7)); SUIT_object maxagelabel = SUIT_createLabel("max age"); SUIT_addChildToObject(pboard,maxagelabel); SUIT_setViewport(maxagelabel,VIEWPORT,SUIT_mapToParent(maxagelabel,0.4,0.701,0.5,0.709)); } void setmaxage() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pMaxAge]); SUIT_setText(SUIT_name("maxage"),CURRENT_VALUE,buffer); } void parsimony(SUIT_object pboard) { SUIT_object parsimony = SUIT_createTypeInBox("parsimony",NULL); SUIT_addChildToObject(pboard,parsimony); SUIT_setViewport(parsimony,VIEWPORT,SUIT_mapToParent(parsimony,0.4,0.51,0.5,0.6)); SUIT_object parsimonylabel = SUIT_createLabel("par simony"); SUIT_addChildToObject(pboard,parsimonylabel); SUIT_setViewport(parsimonylabel,VIEWPORT,SUIT_mapToParent(parsimonylabel,0.4,0.601,0.5,0.609)); } void setparsimony() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pParsimony]); SUIT_setText(SUIT_name("parsimony"),CURRENT_VALUE,buffer); } void fitnesscases(SUIT_object pboard) { SUIT_object fitnesscases = SUIT_createTypeInBox("fitnesscases",NULL); SUIT_addChildToObject(pboard,fitnesscases); SUIT_setViewport(fitnesscases,VIEWPORT,SUIT_mapToParent(fitnesscases,0.4,0.41,0.5,0.5)); SUIT_object fitnesscaseslabel = SUIT_createLabel("fitness cases"); SUIT_addChildToObject(pboard,fitnesscaseslabel); SUIT_setViewport(fitnesscaseslabel,VIEWPORT,SUIT_mapToParent(fitnesscaseslabel,0.4,0.501,0.5,0.509)); } void setfitnesscases() { char buffer[100]; sprintf(buffer,"%d" ,ThisParams->params[pFitnessCases]); SUIT_setText(SUIT_name("fitnesscases"),CURRENT_VALUE,buffer); } void LoadParams(SUIT_object lp) { SUIT_object dbox; dbox = SUIT_createFileBrowserDialogBox("load params file", NULL, "Open file", "Open file named:"); if (SUIT_activateDialogBox (dbox) == REPLY_OK) { paramfile = SUIT_getText(dbox,CURRENT_VALUE); } else //cout << "User pressed cancel\n"; SUIT_destroyObject(dbox); ifstream LoadParameters (paramfile); if (LoadParameters) { ThisParams->Load(LoadParameters); ShowCurrentParams(); } else { SUIT_inform("The file does not exist"); } } void load(SUIT_object pb) { SUIT_object loadparams = SUIT_createButton("load",LoadParams); SUIT_addChildToObject(pb,loadparams); SUIT_setViewport(loadparams,VIEWPORT,SUIT_mapToParent(loadparams,0.7,0.1,0.8,0.2)); } void SaveParams(SUIT_object ep) { SUIT_object dbox; dbox = SUIT_createFileBrowserDialogBox("save params file", NULL,"Save As", "save file as :"); if (SUIT_activateDialogBox (dbox) == REPLY_OK) { char * savefile = SUIT_getText(dbox,CURRENT_VALUE); ofstream paramout (savefile); ThisParams->Save(paramout); } else {} SUIT_destroyObject(dbox); } void save(SUIT_object pb) { SUIT_object saveparams = SUIT_createButton("store parameters", SaveParams); SUIT_addChildToObject(pb,saveparams); SUIT_setViewport(saveparams,VIEWPORT,SUIT_mapToParent(saveparams,0.7,0.3,0.8,0.4)); } void EditParams(SUIT_object ep) { int value; value = atoi(SUIT_getText(SUIT_name("popsize"),CURRENT_VALUE)); if (value <= 0) { SUIT_inform("Population size invalid"); return; } else { ThisParams->params[pPopSize] = value; } value = atoi(SUIT_getText(SUIT_name("genlimit"),CURRENT_VALUE)); if (value <= 0) { SUIT_inform("Generation size invalid"); return; } else { ThisParams->params[pGenerateLimit] = value; } value = atoi(SUIT_getText(SUIT_name("maxexpr"),CURRENT_VALUE)); if ((value <= 0)|| (value > 256)) { SUIT_inform("Max expression size invalid invalid"); return; } else { ThisParams->params[pMaxExpr] = value; } value = atoi(SUIT_getText(SUIT_name("muterate"),CURRENT_VALUE)); if (value < 0) { SUIT_inform("Mutation rate invalid"); return; } else { ThisParams->params[pMuteRate] = value; } value = atoi(SUIT_getText(SUIT_name("crosself"),CURRENT_VALUE)); if ((value != 0) && (value !=1)) { SUIT_inform("Cross self only accepts 0 or 1"); return; } else { ThisParams->params[pCrossSelf] = value; } value = atoi(SUIT_getText(SUIT_name("unrestrictwt"),CURRENT_VALUE)); if (value <= 0) { SUIT_inform("Unrestrict weight invalid"); return; } else { ThisParams->params[pUnRestrictWt] = value; } value = atoi(SUIT_getText(SUIT_name("crosswt"),CURRENT_VALUE)); if (value <= 0) { SUIT_inform("Cross weight invalid"); return; } else { ThisParams->params[pCrossWt] = value; } value = atoi(SUIT_getText(SUIT_name("mutewt"),CURRENT_VALUE)); if (value < 0) { SUIT_inform("Mute Weight invalid"); return; } else { ThisParams->params[pMuteWt] = value; } value = atoi(SUIT_getText(SUIT_name("annealxwt"),CURRENT_VALUE)); if (value < 0) { SUIT_inform("Anneal Cross wt invalid"); return; } else { ThisParams->params[pAnnealCrossWt] = value; } value = atoi(SUIT_getText(SUIT_name("annealmtwt"),CURRENT_VALUE)); if (value < 0) { SUIT_inform("Anneal Mute Wt invalid"); return; } else { ThisParams->params[pAnnealMuteWt] = value; } value = atoi(SUIT_getText(SUIT_name("copywt"),CURRENT_VALUE)); if (value <= 0) { SUIT_inform("Copy weight invalid"); return; } else { ThisParams->params[pCopyWt] = value; } value = atoi(SUIT_getText(SUIT_name("mutenodewt"),CURRENT_VALUE)); if (value <= 0) { SUIT_inform("Mute Node Weight invalid"); return; } else { ThisParams->params[pMuteNodeWt] = value; } value = atoi(SUIT_getText(SUIT_name("muteconstwt"),CURRENT_VALUE)); if (value < 0) { SUIT_inform("Mute Const Wt invalid"); return; } else { ThisParams->params[pMuteConstWt] = value; } value = atoi(SUIT_getText(SUIT_name("muteshrinkwt"),CURRENT_VALUE)); if (value < 0) { SUIT_inform("Mute Shrink Weight invalid"); return; } else { ThisParams->params[pMuteShrinkWt] = value; } value = atoi(SUIT_getText(SUIT_name("tournsize"),CURRENT_VALUE)); if (value <= 0) { SUIT_inform("Tournament size is invalid"); return; } else { ThisParams->params[pTournSize] = value; } value = atoi(SUIT_getText(SUIT_name("materadius"),CURRENT_VALUE)); if (value <= 0) { SUIT_inform("Mate Radius is invalid"); return; } else { ThisParams->params[pMateRadius] = value; } value = atoi(SUIT_getText(SUIT_name("gaussregion"),CURRENT_VALUE)); if ((value != 0)&& (value != 1)) { SUIT_inform("Gauss Region accepts 0 or 1"); return; } else { ThisParams->params[pGaussRegion] = value; } value = atoi(SUIT_getText(SUIT_name("killtourn"),CURRENT_VALUE)); if (value <= 0) { SUIT_inform("Kill tourn invalid"); return; } else { ThisParams->params[pKillTourn] = value; } value = atoi(SUIT_getText(SUIT_name("maxage"),CURRENT_VALUE)); if (value < 0) { SUIT_inform("Max Age accepts 0 or 1"); return; } else { ThisParams->params[pMaxAge] = value; } value = atoi(SUIT_getText(SUIT_name("parsimony"),CURRENT_VALUE)); if ((value != 0) && (value != 1)) { SUIT_inform("Parsimony accepts 0 or 1"); return; } else { ThisParams->params[pParsimony] = value; } value = atoi(SUIT_getText(SUIT_name("fitnesscases"),CURRENT_VALUE)); if (value <= 0) { SUIT_inform("Fitness cases invalid"); return; } else { ThisParams->params[pFitnessCases] = value; } value = atoi(SUIT_getText(SUIT_name("repeateval"),CURRENT_VALUE)); if ((value != 0)&&(value != 1)) { SUIT_inform("Repeat Eval accepts 0 or 1"); return; } else { ThisParams->params[pRepeatEval] = value; } value = atoi(SUIT_getText(SUIT_name("selectmethod"),CURRENT_VALUE)); if ((value < 1)&& (value > 4)) { SUIT_inform("There are only four methods available"); return; } else { ThisParams->params[pSelectMethod] = value; } SUIT_inform("All Changes Set"); } void edit(SUIT_object pb) { SUIT_object editparams = SUIT_createButton("set changes", EditParams); SUIT_addChildToObject(pb,editparams); SUIT_setViewport(editparams,VIEWPORT,SUIT_mapToParent(editparams,0.7,0.5,0.8,0.6)); } void UseDefaultParams(SUIT_object dp) { ifstream gpParams ("gp.ini"); if (gpParams) { ThisParams->Load(gpParams); if (dp == SUIT_name("use defaults")) ShowCurrentParams(); } SUIT_inform("defaults loaded"); } void usedefaults(SUIT_object pb) { SUIT_object usedefault = SUIT_createButton("use defaults", UseDefaultParams); SUIT_addChildToObject(pb,usedefault); SUIT_setViewport(usedefault,VIEWPORT,SUIT_mapToParent(usedefault,0.7,0.7,0.8,0.8)); } void ShowCurrentParams() { setpopsize(); setgenlimit(); setmaxexpr(); setmuterate(); setcrosself(); setunrestrictwt(); setcrosswt(); setmutewt(); setannealxwt(); setannealmtwt(); setcopywt(); setmutenodewt(); setmuteconstwt(); setmuteshrinkwt(); settournsize(); setmateradius(); setgaussregion(); setkilltourn(); setmaxage(); setparsimony(); setselectmethod(); setrepeateval(); setfitnesscases(); } SUIT_object createparamsboard(char* name) { SUIT_object pb = SUIT_createBulletinBoard(name); SUIT_object pblabel = SUIT_createLabel("Set Up Parameters"); SUIT_addChildToObject(pb,pblabel); SUIT_setBoolean(pblabel,SHRINK_TO_FIT,FALSE); SUIT_setViewport(pblabel,VIEWPORT,SUIT_mapToParent(pblabel,0.0,0.95,1.0,1.0)); SUIT_setColor(pblabel,BACKGROUND_COLOR,GP_defColor("midnightblue",TRUE)); SUIT_setColor(pblabel,FOREGROUND_COLOR,GP_defColor("white",FALSE)); popsize(pb); SUIT_deluxeSetBoolean(SUIT_name("popsize"),SHRINK_TO_FIT,FALSE,CLASS); genlimit(pb); maxexpr(pb); muterate(pb); crosself(pb); unrestrictwt(pb); crosswt(pb); mutewt(pb); annealxwt(pb); annealmtwt(pb); copywt(pb); mutenodewt(pb); muteconstwt(pb); muteshrinkwt(pb); tournsize(pb); materadius(pb); gaussregion(pb); killtourn(pb); maxage(pb); parsimony(pb); fitnesscases(pb); selectmethod(pb); repeateval(pb); SUIT_deluxeSetBoolean(SUIT_name("fitnesscases"),SHRINK_TO_FIT,TRUE,CLASS); load(pb); save(pb); edit(pb); usedefaults(pb); return pb; } /* Create a dialogue box that allows a user to change any parameters or use the defaults */ /************************************************************************/ void SetParams(SUIT_object p) { SUIT_object paramsBox, paramsBoard; paramsBoard = createparamsboard("paramsboard"); ShowCurrentParams(); paramsBox = SUIT_createOKCancelDialogBox("parambox",paramsBoard,NULL); SUIT_setViewport(paramsBox,VIEWPORT,SUIT_defViewport(5,5,800,800)); SUIT_setViewport(paramsBoard,VIEWPORT,SUIT_defViewport(5,5,700,700)); if (SUIT_activateDialogBox(paramsBox) == REPLY_OK) {} SUIT_destroyObject(paramsBox); } /*************************************************************************/ /* create the parameter options menu */ void MutuallyExclusive(SUIT_object popchild) { SUIT_setColor(popchild,BACKGROUND_COLOR,GP_defColor("white",FALSE)); } void GetChrome(SUIT_object b) { int val; val = atoi(SUIT_getText(SUIT_getChild(SUIT_getParent(b),1),CURRENT_VALUE)); if (val < ThisParams->params[pPopSize]) { current_pop = val; pop1->pop[current_pop]->tree_display(whichtree); } else SUIT_inform("This individual is not in the population."); } void createpopchip() { SUIT_object popchip, popbutton, poptype; popchip = SUIT_createStacker("population chip"); poptype = SUIT_createTypeInBox("poptype",NULL); popbutton = SUIT_createButton("current chrome", GetChrome); SUIT_addChildToObject(popchip,popbutton); SUIT_addChildToObject(popchip,poptype); SUIT_cycleObject(popchip); } void GetBest(SUIT_object b) { current_pop = pop1->BestMember; char string[100]; sprintf(string,"%d",current_pop); SUIT_setText(SUIT_name("poptype"),CURRENT_VALUE,string); pop1->pop[current_pop]->tree_display(whichtree); } void createbestchrome() { SUIT_object bestchrbutton; //bestchr, bestchrlabel, bestchrbutton; // bestchr = SUIT_createStacker("bestchr"); //bestchrlabel = SUIT_createLabel("best individual"); bestchrbutton = SUIT_createButton("bestchrbutton", GetBest); // SUIT_addChildToObject(bestchr,bestchrbutton); // SUIT_addChildToObject(bestchr,bestchrlabel); // SUIT_cycleObject(bestchr); } void setupOptionMenu() { SUIT_object parameterMenu; parameterMenu = SUIT_createPullDownMenu("Parameters"); SUIT_addToMenu(parameterMenu,"Set parameters",SetParams); } void Quit(SUIT_object e) { //delete pop1; //delete ThisParams; genbreak->disposelist(); //delete genbreak; SUIT_done(SAVE_SUI_FILE,EXIT_APPLICATION); } void Abort(SUIT_object e) { SUIT_done(DO_NOT_SAVE_SUI_FILE,EXIT_APPLICATION); } void Print(SUIT_object p) { system("screendump -ce |psraster -i |lpr -Ppscb"); } void setupFileMenu() { SUIT_object fileMenu; fileMenu = SUIT_createPullDownMenu("File"); SUIT_addToMenu(fileMenu,"Open",PopUpFileBox); SUIT_addToMenu(fileMenu,"Save",SaveFile); SUIT_addToMenu(fileMenu,"Save as", SaveAs); SUIT_addToMenu(fileMenu,"Print",Print); SUIT_addToMenu(fileMenu,"Quit",Quit); SUIT_addToMenu(fileMenu,"Abort",Abort); } /* int compare (list * l,breakpoint * one, breakpoint * two) { int a = one->getbreakpoint(); int b = two->getbreakpoint(); if (a == 10) if (a == b) { l->removebreakpoint(one); return (0b); } void swap(breakpoint * one, breakpoint * two) { int temp = one->getbreakpoint(); int j = two->getbreakpoint(); one->setbreakpoint(j); two->setbreakpoint(temp); } void sortlist(list * l) { int swapped; do { swapped = 0; l->resetlist(); for (int j = 0; j< ((int) l->size ); j++) { //cout << "am calling compare with " << (breakpoint *) l->currentbreakpoint() << endl; if (compare(l,(breakpoint *) l->currentbreakpoint(),(breakpoint *) l->nextbreakpoint())) { swap((breakpoint *) l->currentbreakpoint(),(breakpoint *) l->nextbreakpoint()); swapped = 1; } } } while (swapped); } */ void MakeBreakPoints(list * l) { Do_intervals(l); } int Do_specifics(list * l) { int val; val = atoi(SUIT_getText(SUIT_name("specifictin"),CURRENT_VALUE)); if (val == 0) { SUIT_inform("The number entered was not an integer"); } else { l->resetlist(); // breakpoint * current = (breakpoint *) l->getbreakpoint(); breakpoint * bp = new breakpoint(val); l->insertbreakpoint(bp); //if((val > current->getbreakpoint()) || (l->listEmpty())) //{ //l->insertbreakpoint(bp); //l->sortlist(); //l->setCurrentBreakpoint(current); //} //else //delete bp; } return val; } void Do_intervals(list * l) { int gensize, interval, currentvalue; //cout << "got here 1" << endl; interval = atoi(SUIT_getText(SUIT_name("intertin"),CURRENT_VALUE)); gensize = ThisParams->params[pGenerateLimit]; if ((l->size) > 1) { currentvalue = ((breakpoint *) l->currentbreakpoint())->getbreakpoint(); //cout << "the current value is " << currentvalue << endl; l->resetlist(); } else { currentvalue = -1; //cout << "the current value is " << currentvalue << endl; } for (int i = 0; i< gensize + interval; i = i+ interval) { if((i > currentvalue) || (l->listEmpty())) { if ((i != 10)) { //cout << "got here " << i << endl; breakpoint * bp = new breakpoint(i); l->insertbreakpoint(bp); } } } l->sortlist(); l->resetlist(); if (currentvalue != -1) { for (int counter = 0; counter < (int)l->size; counter++) { l->nextbreakpoint(); //cout << "this is in the loop " << counter << endl; if (currentvalue == (int) ((breakpoint*) l->currentbreakpoint())->getbreakpoint()) { //cout << ((breakpoint*) l->currentbreakpoint())->getbreakpoint() << endl; //cout << "am skipping breakpoints" <size + 1; } } //cout << "got out"; //l->setCurrentBreakpoint(current); } } void Addextra(SUIT_object a) { int isok = Do_specifics(genbreak); if (isok != 0) SUIT_setText(SUIT_name("specifictin"),CURRENT_VALUE," "); } boolean CheckInterval(SUIT_object p) { int interval = atoi(SUIT_getText(SUIT_name("intertin"),CURRENT_VALUE)); if ((interval < 0) || (interval > ThisParams->params[pGenerateLimit])) { SUIT_inform("The interval must be an integer between 10 - maximum size"); return FALSE; } else return TRUE; } void AddBreakpoint(SUIT_object ab) { SUIT_object addbpdbox, addbpbox, abplabel,addbpbutton, interlbl, specificlbl, intertin, specifictin; addbpbox = SUIT_createBulletinBoard("addbpbox"); addbpbutton = SUIT_createButton("add extra breakpoint",Addextra); abplabel = SUIT_createLabel("Add Breakpoints"); interlbl = SUIT_createLabel("Enter the size of the interval for breaks :"); intertin = SUIT_createTypeInBox("intertin",NULL); specificlbl = SUIT_createLabel("Enter any other breaks (i.e 12,45,) :"); specifictin = SUIT_createTypeInBox("specifictin",NULL); SUIT_addChildToObject(addbpbox,addbpbutton); SUIT_addChildToObject(addbpbox,abplabel); SUIT_addChildToObject(addbpbox,interlbl); SUIT_addChildToObject(addbpbox,intertin); SUIT_addChildToObject(addbpbox,specificlbl); SUIT_addChildToObject(addbpbox,specifictin); addbpdbox = SUIT_createOKCancelDialogBox("addbpdbox",addbpbox,CheckInterval); SUIT_setViewport(addbpdbox,VIEWPORT,SUIT_defViewport(206,296,679,551)); SUIT_setViewport(addbpbox,VIEWPORT,SUIT_defViewport(23,22,366,230)); SUIT_setBoolean(abplabel,SHRINK_TO_FIT,FALSE); SUIT_setViewport(addbpbutton,VIEWPORT,SUIT_defViewport(189,12,330,38)); SUIT_setColor(abplabel,BACKGROUND_COLOR,GP_defColor("midnightblue",TRUE)); SUIT_setColor(abplabel,FOREGROUND_COLOR,GP_defColor("white",FALSE)); SUIT_setViewport(abplabel,VIEWPORT,SUIT_defViewport(6,176,336,203)); SUIT_setViewport(intertin,VIEWPORT,SUIT_defViewport(229,117,334,143)); SUIT_setText(SUIT_name("intertin"),CURRENT_VALUE,"10"); SUIT_setFont(interlbl,FONT,GP_defFont("times","bold",12)); SUIT_setViewport(interlbl,VIEWPORT,SUIT_defViewport(5,118,217,142)); SUIT_setFont(specificlbl,FONT,GP_defFont("times","bold",12)); SUIT_setViewport(specificlbl,VIEWPORT,SUIT_defViewport(6,44,195,77)); SUIT_setViewport(specifictin,VIEWPORT,SUIT_defViewport(224,49,334,78)); if (SUIT_activateDialogBox(addbpdbox) == REPLY_OK) { MakeBreakPoints(genbreak); //genbreak->sortlist(); //cout << "sortedlist" <resetlist(); //cout << "reset list"; } SUIT_destroyObject(addbpdbox); } void setupBreakpointMenu() { SUIT_object breakmenu; breakmenu = SUIT_createPullDownMenu("Breakpoint"); SUIT_addToMenu(breakmenu,"Add generation breakpoint", AddBreakpoint); } /* create the menubar for all the menus */ void createfilebar() { SUIT_object filebar; filebar = SUIT_createStacker("menubar"); SUIT_addChildToObject(filebar,SUIT_name("File")); SUIT_addChildToObject(filebar,SUIT_name("Parameters")); SUIT_addChildToObject(filebar,SUIT_name("Display_rect")); SUIT_addChildToObject(filebar,SUIT_name("Display_text")); SUIT_addChildToObject(filebar,SUIT_name("Display_Evaluation")); SUIT_addChildToObject(filebar,SUIT_name("Breakpoint")); SUIT_addChildToObject(filebar,SUIT_name("Help")); SUIT_cycleObject(filebar); SUIT_setViewport(filebar,VIEWPORT,SUIT_defViewport(0,424,110,449)); } void drawchromes(SUIT_object o) { // SUIT_setViewport(o,VIEWPORT,SUIT_defViewport(510,350,600,450)); // GP_beveledDiamond (GP_mapRectangle(GP_defRectangle(0.0,0.0,0.1,0.1)),SUIT_getColor(o,BACKGROUND_COLOR), FALSE, 2); } void Zoomin (SUIT_object zin, SUIT_event myEvent) { double val; char buffer[100]; val = atof(SUIT_getText(SUIT_getChild(SUIT_getParent(zin),5),LABEL)); if (val >= 150) { return; } else { val = val + 10; sprintf(buffer,"%.0f",val); SUIT_setText(SUIT_getChild(SUIT_getParent(zin),5),LABEL,buffer); whichtree = getdisp(SUIT_getParent(zin)); pop1->pop[current_pop]->tree_display(whichtree); } } void Zoomout(SUIT_object zout, SUIT_event myevent) { double val; char buffer[100]; val = atof(SUIT_getText(SUIT_getChild(SUIT_getParent(zout),5),LABEL)); if (val <= 10.0) { return; } else { val = val - 10.0; sprintf(buffer,"%.0f",val); SUIT_setText(SUIT_getChild(SUIT_getParent(zout),5),LABEL,buffer); whichtree = getdisp(SUIT_getParent(zout)); pop1->pop[current_pop]->tree_display(whichtree); } } void SetDisplayStyle(SUIT_object pd) { enum {h_bar,v_bar,lbl,zi,zo,zl,cm,rm}; SUIT_setViewport(SUIT_getChild(pd,h_bar),VIEWPORT,SUIT_mapToParent(SUIT_getChild(pd,h_bar),0.7,0.0,1.0,0.04)); SUIT_setViewport(SUIT_getChild(pd,v_bar),VIEWPORT,SUIT_mapToParent(SUIT_getChild(pd,v_bar),0.95,0.04,1.0,0.8)); SUIT_setText(SUIT_getChild(pd,lbl),LABEL,"no tree"); SUIT_setBoolean(SUIT_getChild(pd,lbl),SHRINK_TO_FIT,FALSE); SUIT_setBoolean(SUIT_getChild(pd,lbl),HAS_BORDER,TRUE); SUIT_setViewport(SUIT_getChild(pd,lbl),VIEWPORT,SUIT_mapToParent(SUIT_getChild(pd,lbl),0.3,0.0,0.7,0.04)); SUIT_setBoolean(SUIT_getChild(pd,zi),SHRINK_TO_FIT, FALSE); SUIT_setText(SUIT_getChild(pd,zi),LABEL,"+"); SUIT_setViewport(SUIT_getChild(pd,zi),VIEWPORT,SUIT_mapToParent(SUIT_getChild(pd,zi),0.0,0.0,0.1,0.04)); SUIT_setBoolean(SUIT_getChild(pd,zo),SHRINK_TO_FIT, FALSE); SUIT_setText(SUIT_getChild(pd,zo),LABEL,"-"); SUIT_setViewport(SUIT_getChild(pd,zo),VIEWPORT,SUIT_mapToParent(SUIT_getChild(pd,zo),0.2,0.0,0.3,0.04)); SUIT_setBoolean(SUIT_getChild(pd,zl),SHRINK_TO_FIT, FALSE); SUIT_setText(SUIT_getChild(pd,zl),LABEL,"100"); SUIT_setBoolean(SUIT_getChild(pd,zl),HAS_BORDER,TRUE); SUIT_setViewport(SUIT_getChild(pd,zl),VIEWPORT,SUIT_mapToParent(SUIT_getChild(pd,zl),0.1,0.0,0.2,0.04)); SUIT_setBoolean(SUIT_getChild(pd,cm),SHRINK_TO_FIT, FALSE); SUIT_setText(SUIT_getChild(pd,cm),LABEL,"*"); SUIT_setViewport(SUIT_getChild(pd,cm),VIEWPORT,SUIT_mapToParent(SUIT_getChild(pd,cm),0.95,0.9,1.0,1.0)); SUIT_setBoolean(SUIT_getChild(pd,rm),SHRINK_TO_FIT, FALSE); SUIT_setText(SUIT_getChild(pd,rm),LABEL,"0"); SUIT_setViewport(SUIT_getChild(pd,rm),VIEWPORT,SUIT_mapToParent(SUIT_getChild(pd,rm),0.95,0.8,1.0,0.9)); SUIT_cycleObject(SUIT_getChild(pd,h_bar)); SUIT_cycleObject(SUIT_getChild(pd,v_bar)); } void PaintZoominWidget(SUIT_object zi) { GP_ellipse(GP_defRectangle(0.1,0.4,0.9,0.9)); GP_rectangleCoord(0.45,0.1,0.55,0.4); GP_justifyTextInRectangle("+",JUSTIFY_CENTER,GP_defRectangle(0.1,0.4,0.9,0.9)); } void PaintZoomoutWidget(SUIT_object zi) { GP_ellipse(GP_defRectangle(0.1,0.4,0.9,0.9)); GP_rectangleCoord(0.45,0.1,0.55,0.4); GP_justifyTextInRectangle("-",JUSTIFY_CENTER,GP_defRectangle(0.1,0.4,0.9,0.9)); } SUIT_object CreateZoominWidget(char * name) { SUIT_object zoomin; zoomin = SUIT_createObject(name, "Zoom in class"); SUIT_addDisplayToObject(zoomin, "standard",Zoomin, PaintZoominWidget); SUIT_registerClass ("Zoom in class", CreateZoominWidget, "widget with zoomin icon"); return (zoomin); } SUIT_object CreateZoomoutWidget(char * name) { SUIT_object zoomout; zoomout = SUIT_createObject(name, "Zoom out class"); SUIT_addDisplayToObject(zoomout, "standard",Zoomout, PaintZoomoutWidget); SUIT_registerClass ("Zoom out class", CreateZoomoutWidget, "widget with zoomout icon"); return (zoomout); } void CreateZoomButtons() { SUIT_object zp1,zm1,zp2,zm2,zp3,zm3,zp4,zm4,zp5,zm5,zp6,zm6,zl1,zl2,zl3,zl4,zl5,zl6; zp1 = CreateZoominWidget("+1"); zm1 = CreateZoomoutWidget("-1"); zp2 = CreateZoominWidget("+2"); zm2 = CreateZoomoutWidget("-2"); zp3 = CreateZoominWidget("+3"); zm3 = CreateZoomoutWidget("-3"); zp4 = CreateZoominWidget("+4"); zm4 = CreateZoomoutWidget("-4"); zp5 = CreateZoominWidget("+5"); zm5 = CreateZoomoutWidget("-5"); zp6 = CreateZoominWidget("+6"); zm6 = CreateZoomoutWidget("-6"); zl1 = SUIT_createLabel("zl1"); zl2 = SUIT_createLabel("zl2"); zl3 = SUIT_createLabel("zl3"); zl4 = SUIT_createLabel("zl4"); zl5 = SUIT_createLabel("zl5"); zl6 = SUIT_createLabel("zl6"); } void PaintGraphWidget (SUIT_object graph) { GP_lineCoord(0.1,0.2,0.9,0.2); GP_lineCoord(0.1,0.2,0.1,0.9); GP_justifyTextInRectangle(OBJECT_NAME(graph),JUSTIFY_CENTER,GP_defRectangle(0.0,0.85,1.0,1.0)); GP_justifyTextInRectangle("max gens",JUSTIFY_CENTER_RIGHT,GP_defRectangle(0.8,0.1,1.0,0.2)); GP_justifyTextInRectangle("0",JUSTIFY_CENTER,GP_defRectangle(0.0,0.1,0.2,0.2)); } SUIT_object CreateGraphWidget(char *name) { SUIT_object graph; /* 2 */ graph = SUIT_createObject(name, "Graph display class"); /* 3 */ SUIT_addDisplayToObject (graph, "standard", NULL, PaintGraphWidget); /* 4 */ SUIT_registerClass ("Graph display class", CreateGraphWidget, "This class of widgets displays a crosshair that moves under mouse control"); /* 5 */ return (graph); /* 6 */ } /* void drawingraph(SUIT_object ob) { SUIT_viewport temp_vp1; rectangle recvView; GP_pushGraphicsState(); temp_vp1 = SUIT_getViewport(fitnessgraph, VIEWPORT); recvView.bottom_left.x = temp_vp1.bottom_left.x ; recvView.bottom_left.y = temp_vp1.bottom_left.y; recvView.top_right.x = temp_vp1.top_right.x ; recvView.top_right.y = temp_vp1.top_right.y; GP_setViewport(recvView); float value = 10; float previousvalue; for (int i = 1; i < 11; i++) { previousvalue = value; value = 10.0 * i; GP_lineCoord((0.1+1),(0.1+i),(0.6+i),(0.6+i)); } GP_popGraphicsState(); } */ void CreateCentreMeButtons() { SUIT_object cm1,cm2,cm3,cm4,cm5,cm6; cm1 = CreateCentreMeWidget("cm1"); cm2 = CreateCentreMeWidget("cm2"); cm3 = CreateCentreMeWidget("cm3"); cm4 = CreateCentreMeWidget("cm4"); cm5 = CreateCentreMeWidget("cm5"); cm6 = CreateCentreMeWidget("cm6"); } void CreateReturnMeButtons() { SUIT_object rm1,rm2,rm3,rm4,rm5,rm6; rm1 = CreateReturnMeWidget("rm1"); rm2 = CreateReturnMeWidget("rm2"); rm3 = CreateReturnMeWidget("rm3"); rm4 = CreateReturnMeWidget("rm4"); rm5 = CreateReturnMeWidget("rm5"); rm6 = CreateReturnMeWidget("rm6"); } void CreateWidgLabels() { SUIT_object l1,l2,l3,l4,l5,l6; l1 = SUIT_createLabel("l1"); l2 = SUIT_createLabel("l2"); l3 = SUIT_createLabel("l3"); l4 = SUIT_createLabel("l4"); l5 = SUIT_createLabel("l5"); l6 = SUIT_createLabel("l6"); } void endtings(SUIT_object end) { delete pop1; SUIT_setBoolean(SUIT_name("create population"),DISABLED,FALSE); SUIT_setBoolean(SUIT_name("perform generations"),DISABLED,TRUE); SUIT_setBoolean(SUIT_name("Display_Stats"),DISABLED,TRUE); SUIT_setBoolean(SUIT_name("delete population"),DISABLED,TRUE); SUIT_setText(SUIT_name("whichgen"),LABEL,"no pop"); SUIT_setText(SUIT_name("l1"),LABEL,"no tree"); SUIT_setText(SUIT_name("l2"),LABEL,"no tree"); SUIT_setText(SUIT_name("l3"),LABEL,"no tree"); SUIT_setText(SUIT_name("l4"),LABEL,"no tree"); SUIT_setText(SUIT_name("l5"),LABEL,"no tree"); SUIT_setText(SUIT_name("l6"),LABEL,"no tree"); genbreak->disposelist(); x = 0.0; increment = 0.0; SUIT_allObjectsRequireRedisplay(NULL); SUIT_performRedisplay(); } void createstatschips(SUIT_object stats) { SUIT_object stats_dbox; SUIT_object statsboard, tl1,tl2,tl3,tl4,tl5,tl6,va1,va2,va3,va4,va5,va6,statslabel,sd,var,sd1,sd2,sd3,sd4,sd5,sd6; SUIT_object treestack1,treestack2,treestack3,treestack4,treestack5,treestack6; statsboard = SUIT_createBulletinBoard("statsboard"); treestack1 = SUIT_createStacker("treestack1"); treestack2 = SUIT_createStacker("treestack2"); treestack3 = SUIT_createStacker("treestack3"); treestack4 = SUIT_createStacker("treestack4"); treestack5 = SUIT_createStacker("treestack5"); treestack6 = SUIT_createStacker("treestack6"); tl1 = SUIT_createLabel("tl1"); tl2 =SUIT_createLabel("tl2"); tl3 = SUIT_createLabel("tl3"); tl4 = SUIT_createLabel("tl4"); tl5 = SUIT_createLabel("tl5"); tl6 = SUIT_createLabel("tl6"); statslabel = SUIT_createLabel("Pop Statistics"); sd = SUIT_createLabel("SDeviation"); var = SUIT_createLabel("Variance"); sd1 = SUIT_createLabel("sd1"); sd2 = SUIT_createLabel("sd2"); sd3 = SUIT_createLabel("sd3"); sd4 = SUIT_createLabel("sd4"); sd5 = SUIT_createLabel("sd5"); sd6 = SUIT_createLabel("sd6"); va1 = SUIT_createLabel("va1"); va2 = SUIT_createLabel("va2"); va3 = SUIT_createLabel("va3"); va4 = SUIT_createLabel("va4"); va5 = SUIT_createLabel("va5"); va6 = SUIT_createLabel("va6"); SUIT_addChildToObject(treestack1,va1); SUIT_addChildToObject(treestack2,va2); SUIT_addChildToObject(treestack3,va3); SUIT_addChildToObject(treestack4,va4); SUIT_addChildToObject(treestack5,va5); SUIT_addChildToObject(treestack6,va6); SUIT_addChildToObject(statsboard,statslabel); SUIT_addChildToObject(statsboard,sd); SUIT_addChildToObject(statsboard,var); SUIT_addChildToObject(treestack1,sd1); SUIT_addChildToObject(treestack2,sd2); SUIT_addChildToObject(treestack3,sd3); SUIT_addChildToObject(treestack4,sd4); SUIT_addChildToObject(treestack5,sd5); SUIT_addChildToObject(treestack6,sd6); SUIT_addChildToObject(treestack1,tl1); SUIT_addChildToObject(treestack2,tl2); SUIT_addChildToObject(treestack3,tl3); SUIT_addChildToObject(treestack4,tl4); SUIT_addChildToObject(treestack5,tl5); SUIT_addChildToObject(treestack6,tl6); SUIT_addChildToObject(statsboard,treestack1); SUIT_addChildToObject(statsboard,treestack2); SUIT_addChildToObject(statsboard,treestack3); SUIT_addChildToObject(statsboard,treestack4); SUIT_addChildToObject(statsboard,treestack5); SUIT_addChildToObject(statsboard,treestack6); pop1->DisplayStats(); stats_dbox = SUIT_createOKCancelDialogBox("statsdbox",statsboard,NULL); SUIT_setViewport(stats_dbox,VIEWPORT,SUIT_defViewport(163,185,605,511)); SUIT_setViewport(statsboard,VIEWPORT,SUIT_defViewport(32,23,332,290)); SUIT_setBoolean(statslabel,SHRINK_TO_FIT,FALSE); SUIT_setViewport(statslabel,VIEWPORT,SUIT_mapToParent(statslabel,0.0,0.9,1.0,1.0)); SUIT_setColor(statslabel,BACKGROUND_COLOR,GP_defColor("midnightblue",TRUE)); SUIT_setColor(statslabel,FOREGROUND_COLOR,GP_defColor("white",FALSE)); SUIT_setViewport(sd,VIEWPORT,SUIT_mapToParent(sd,0.4,0.8,0.7,0.9)); SUIT_setViewport(var,VIEWPORT,SUIT_mapToParent(var,0.7,0.8,1.0,0.9)); SUIT_cycleObject(treestack1); SUIT_cycleObject(treestack2); SUIT_cycleObject(treestack3); SUIT_cycleObject(treestack4); SUIT_cycleObject(treestack5); SUIT_cycleObject(treestack6); SUIT_setBoolean(treestack1,SHRINK_TO_FIT,FALSE); SUIT_setBoolean(treestack2,SHRINK_TO_FIT,FALSE); SUIT_setBoolean(treestack3,SHRINK_TO_FIT,FALSE); SUIT_setBoolean(treestack4,SHRINK_TO_FIT,FALSE); SUIT_setBoolean(treestack5,SHRINK_TO_FIT,FALSE); SUIT_setBoolean(treestack6,SHRINK_TO_FIT,FALSE); SUIT_setViewport(treestack1,VIEWPORT,SUIT_mapToParent(treestack1,0.0,0.666,1.0,0.79)); SUIT_setViewport(treestack2,VIEWPORT,SUIT_mapToParent(treestack2,0.0,0.533,1.0,0.666)); SUIT_setViewport(treestack3,VIEWPORT,SUIT_mapToParent(treestack3,0.0,0.4,1.0,0.533)); SUIT_setViewport(treestack4,VIEWPORT,SUIT_mapToParent(treestack4,0.0,0.266,1.0,0.4)); SUIT_setViewport(treestack5,VIEWPORT,SUIT_mapToParent(treestack5,0.0,0.133,1.0,0.266)); SUIT_setViewport(treestack6,VIEWPORT,SUIT_mapToParent(treestack6,0.0,0.0,1.0,0.133)); if (SUIT_activateDialogBox(stats_dbox) == REPLY_OK) {} SUIT_destroyObject(stats_dbox); } void givehelp(SUIT_object h) { SUIT_object helpdbox, helpbox; helpbox = SUIT_createTextEditor("helpscroller",NULL); SUIT_setText(helpbox,CURRENT_VALUE,SUIT_textOfFile("help")); helpdbox = SUIT_createOKCancelDialogBox("helpdbox",helpbox,NULL); SUIT_setViewport(helpdbox,VIEWPORT,SUIT_defViewport(400,400,800,800)); if (SUIT_activateDialogBox(helpdbox) == REPLY_OK) {} SUIT_destroyObject(helpdbox); } void main(int argc, char* argv[]) { SUIT_object help,start, draw, gen, whichgen,genat, end, stats; SUIT_init(argv[0]); help = SUIT_createButton("Help",givehelp); end = SUIT_createButton("delete population", endtings); SUIT_setBoolean(end,DISABLED,TRUE); start = SUIT_createButton ("create population" , begintings); // button to start the program gen = SUIT_createButton("perform generations",DoGens); SUIT_setBoolean(gen,DISABLED,TRUE); whichgen = SUIT_createLabel("whichgen"); genat = SUIT_createLabel("At generation :"); stats = SUIT_createButton("Display_stats",createstatschips); /* I don't like this but only way to do it as yet */ displayrect = TRUE; /* create all the scrollbars */ createpopchip(); createbestchrome(); CreateBoundedValues(); CreateWidgLabels(); CreateZoomButtons(); CreateCentreMeButtons(); CreateReturnMeButtons(); /* create widgets that display programs */ CreateChips(); CreateGraphWidget("Best Fitness"); CreateGraphWidget("Average Fitness"); SUIT_addChildToObject(SUIT_name("disp1"),SUIT_name("h1")); SUIT_addChildToObject(SUIT_name("disp1"),SUIT_name("v1")); SUIT_addChildToObject(SUIT_name("disp1"),SUIT_name("l1")); SUIT_addChildToObject(SUIT_name("disp1"),SUIT_name("+1")); SUIT_addChildToObject(SUIT_name("disp1"),SUIT_name("-1")); SUIT_addChildToObject(SUIT_name("disp1"),SUIT_name("zl1")); SUIT_addChildToObject(SUIT_name("disp1"),SUIT_name("cm1")); SUIT_addChildToObject(SUIT_name("disp1"),SUIT_name("rm1")); SUIT_addChildToObject(SUIT_name("disp2"),SUIT_name("h2")); SUIT_addChildToObject(SUIT_name("disp2"),SUIT_name("v2")); SUIT_addChildToObject(SUIT_name("disp2"),SUIT_name("l2")); SUIT_addChildToObject(SUIT_name("disp2"),SUIT_name("+2")); SUIT_addChildToObject(SUIT_name("disp2"),SUIT_name("-2")); SUIT_addChildToObject(SUIT_name("disp2"),SUIT_name("zl2")); SUIT_addChildToObject(SUIT_name("disp2"),SUIT_name("cm2")); SUIT_addChildToObject(SUIT_name("disp2"),SUIT_name("rm2")); SUIT_addChildToObject(SUIT_name("disp3"),SUIT_name("h3")); SUIT_addChildToObject(SUIT_name("disp3"),SUIT_name("v3")); SUIT_addChildToObject(SUIT_name("disp3"),SUIT_name("l3")); SUIT_addChildToObject(SUIT_name("disp3"),SUIT_name("+3")); SUIT_addChildToObject(SUIT_name("disp3"),SUIT_name("-3")); SUIT_addChildToObject(SUIT_name("disp3"),SUIT_name("zl3")); SUIT_addChildToObject(SUIT_name("disp3"),SUIT_name("cm3")); SUIT_addChildToObject(SUIT_name("disp3"),SUIT_name("rm3")); SUIT_addChildToObject(SUIT_name("disp4"),SUIT_name("h4")); SUIT_addChildToObject(SUIT_name("disp4"),SUIT_name("v4")); SUIT_addChildToObject(SUIT_name("disp4"),SUIT_name("l4")); SUIT_addChildToObject(SUIT_name("disp4"),SUIT_name("+4")); SUIT_addChildToObject(SUIT_name("disp4"),SUIT_name("-4")); SUIT_addChildToObject(SUIT_name("disp4"),SUIT_name("zl4")); SUIT_addChildToObject(SUIT_name("disp4"),SUIT_name("cm4")); SUIT_addChildToObject(SUIT_name("disp4"),SUIT_name("rm4")); SUIT_addChildToObject(SUIT_name("disp5"),SUIT_name("h5")); SUIT_addChildToObject(SUIT_name("disp5"),SUIT_name("v5")); SUIT_addChildToObject(SUIT_name("disp5"),SUIT_name("l5")); SUIT_addChildToObject(SUIT_name("disp5"),SUIT_name("+5")); SUIT_addChildToObject(SUIT_name("disp5"),SUIT_name("-5")); SUIT_addChildToObject(SUIT_name("disp5"),SUIT_name("zl5")); SUIT_addChildToObject(SUIT_name("disp5"),SUIT_name("cm5")); SUIT_addChildToObject(SUIT_name("disp5"),SUIT_name("rm5")); SUIT_addChildToObject(SUIT_name("disp6"),SUIT_name("h6")); SUIT_addChildToObject(SUIT_name("disp6"),SUIT_name("v6")); SUIT_addChildToObject(SUIT_name("disp6"),SUIT_name("l6")); SUIT_addChildToObject(SUIT_name("disp6"),SUIT_name("+6")); SUIT_addChildToObject(SUIT_name("disp6"),SUIT_name("-6")); SUIT_addChildToObject(SUIT_name("disp6"),SUIT_name("zl6")); SUIT_addChildToObject(SUIT_name("disp6"),SUIT_name("cm6")); SUIT_addChildToObject(SUIT_name("disp6"),SUIT_name("rm6")); SetDisplayStyle(SUIT_getParent(SUIT_name("h1"))); SetDisplayStyle(SUIT_getParent(SUIT_name("h2"))); SetDisplayStyle(SUIT_getParent(SUIT_name("h3"))); SetDisplayStyle(SUIT_getParent(SUIT_name("h4"))); SetDisplayStyle(SUIT_getParent(SUIT_name("h5"))); SetDisplayStyle(SUIT_getParent(SUIT_name("h6"))); /* craete all the file menus */ /* make all bounded values children of relevant widget*/ setupOptionMenu(); setupBreakpointMenu(); setupFileMenu(); CreateTreeDisplayParams(); createfilebar(); SUIT_beginStandardApplication(); }