/*----------------------------------------------------------------------*/ /* menudefs.h: Hierarchical menus */ /*----------------------------------------------------------------------*/ #define entries(c) (sizeof c / sizeof (menu_struct)) typedef struct tnode *menu_ptr; typedef struct tnode { char *name; void (*func)(); menu_ptr submenu; int size; } menu_struct; menu_struct Loadmenu[] = { {"weight file", LoadWeight, NULL, 0}, {"train file", LoadTrain, NULL, 0}, {"sample file", LoadSamp, NULL, 0}, {"samples from train file", Train2Samp, NULL, 0}, {"run trainer program", RunTrain, NULL, 0}, {"run sample generator", RunSamp, NULL, 0} }; menu_struct Savemenu[] = { {"weight file", SaveWeight, NULL, 0}, {"sample file", MenuSelect, NULL, 0} }; menu_struct Printmenu[] = { {"Input/Output", MenuSelect, NULL, 0}, {"weights", MenuSelect, NULL, 0}, {"activation", MenuSelect, NULL, 0}, {"network", MenuSelect, NULL, 0} }; menu_struct Parammenu[] = { {"training constant", TConst, NULL, 0}, {"tolerance", SetEpsilon, NULL, 0}, {"tolerance bounds", SetBounds, NULL, 0}, {"randomness magnitude",SetRanMag,NULL, 0}, {"layers", SetLayers, NULL, 0}, {"nodes per layer", SetNodes, NULL, 0}, {"taps per layer", SetTaps, NULL, 0}, {"update timescale", SetUpdate, NULL, 0} }; menu_struct Stylemenu[] = { {"show activation", ShowActive, NULL, 0}, {"show network", ShowNet, NULL, -1}, {"show learning curve", MenuSelect, NULL, 0}, {"disable network graph", DisableDraw, NULL, 0} }; menu_struct Colormenu[] = { {"negative weight", MenuSelect, NULL, 0}, {"positive weight", MenuSelect, NULL, 0}, {"negative activation", MenuSelect, NULL, 0}, {"positive activation", MenuSelect, NULL, 0}, {"input", MenuSelect, NULL, 0}, {"output", MenuSelect, NULL, 0}, {"desired response", MenuSelect, NULL, 0} }; menu_struct AStylemenu[] = { {"binary sigmoidal", BinAct, NULL, 0}, {"bipolar sigmoidal", BipAct, NULL, -1}, {"sinusoid sigmoidal", SinAct, NULL, 0}, {"binary hard-limited", BinHL, NULL, 0}, {"bipolar hard-limited",BipHL, NULL, 0} }; menu_struct Filemenu[] = { {"load", MenuSelect, Loadmenu, entries(Loadmenu)}, {"save", MenuSelect, Savemenu, entries(Savemenu)}, {"print", MenuSelect, Printmenu, entries (Printmenu)}, }; menu_struct Editmenu[] = { {"parameters", MenuSelect, Parammenu, entries(Parammenu)}, {"style", MenuSelect, Stylemenu, entries(Stylemenu)}, {"color", MenuSelect, Colormenu, entries(Colormenu)}, {"title", SetTitle, NULL, 0 } }; menu_struct Learnmenu[] = { {"activation style", MenuSelect, AStylemenu, entries(AStylemenu)}, {"recurrent net", SetRecur, NULL, 0}, {"train network", NetTrain, NULL, 0}, {"last-pattern mode",LastPatMode, NULL, 0}, {"self-organization",SelfOrg, NULL, 0}, {"interrupt", BreakTrain, NULL, 0}, {"reset weights", ResetWeights,NULL, 0}, {"flush taps", FlushTaps, NULL, 0}, {"normalize weights",NormWeights, NULL, 0}, {"run with samples", NetRun, NULL, 0}, {"step mode", SetStep, NULL, 0} }; menu_struct Mainmenu[] = { {"Quit", QuitSelect, NULL, 0}, {"File", MenuSelect, Filemenu, entries(Filemenu)}, {"Edit", MenuSelect, Editmenu, entries(Editmenu)}, {"Learn", MenuSelect, Learnmenu, entries(Learnmenu)} };