MCPcopy Create free account
hub / github.com/devosoft/avida / main

Function main

avida-core/source/utils/process_map/process_map.cc:27–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27int main(int argc, char * argv[])
28{
29 // Setup the default settings...
30 AddSetting("start", 0, "Start of frame window (exclusive; start is skipped)");
31 AddSetting("step", 100, "Number of updates to skip between frames.");
32 AddSetting("stop", 10000, "Last update to frame (inclusive)");
33 AddSetting("seed", 1, "Random number seed");
34 AddSetting("type", 0, "Type of files to load (0=genotype, 1=phenotype)");
35 AddSetting("num_demes", 0, "How many demes in the population (0=none)");
36 AddSetting("num_colors", 65, "Number of colors in map (Use 43 for bright colors)");
37 AddSetting("threshold1", 10, "Abundance threshold for color shift.");
38 AddSetting("threshold2", 100, "Abundance threshold for assigning unique color");
39
40 if (argc == 1) {
41 cerr << endl;
42 cerr << "This program will load in Avida-generated files with the naming scheme" << endl;
43 cerr << "grid_genotype_id.####.dat (where #### = update output)." << endl;
44 cerr << endl;
45 cerr << "Format: " << argv[0] << " {settings...}" << endl;
46 cerr << "Example: " << argv[0] << " start=1000 step=100 stop=2000" << endl;
47 cerr << endl;
48 cerr << "Available settings: " << endl;
49
50 tList<cString> setting_list;
51 tList<int> value_list;
52 value_dict.AsLists(setting_list, value_list);
53
54 while(setting_list.GetSize()) {
55 cString setting = *(setting_list.Pop());
56 int value = *(value_list.Pop());
57 cString desc;
58 desc_dict.Find(setting, desc);
59 cerr << " " << setting << " (default = " << value << ") : "
60 << desc << endl;
61 }
62
63 cerr << endl;
64 cerr << "To run with all defaults, type: " << argv[0] << " go" << endl;
65 cerr << endl;
66 return 1;
67 }
68
69 cerr << "Initializing..." << endl;
70
71 // Load in the command line arguments.
72 for (int arg_num = 1; arg_num < argc; arg_num++) {
73 cString cur_arg(argv[arg_num]);
74
75 // Ignore a "go" argument...
76 if (cur_arg == "go") continue;
77
78 // Otherwise, process the argument.
79 cString key(cur_arg.Pop('='));
80
81 if (value_dict.HasEntry(key) == false) {
82 cerr << "ERROR: Unknown keyword '" << key << "'." << endl;
83 exit(1);
84 }

Callers

nothing calls this directly

Calls 14

AddSettingFunction · 0.85
GetNumLinesMethod · 0.80
CountNumWordsMethod · 0.80
PopWordMethod · 0.80
GetUIntMethod · 0.80
GetSizeMethod · 0.45
PopMethod · 0.45
FindMethod · 0.45
IsNumericMethod · 0.45
AsIntMethod · 0.45
SetValueMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected