# Deal with and store command line parameters # CommandLineHandler.tz (c) 2010 Jacob Schrum. # See Simulation.tz for more copyright information @use Abstract. @use Constants. # Command line @define COMMAND_LINE_COMMAND 0. @define COMMAND_LINE_VAL 1. @define COMMAND_LINE_EXPLAIN 2. @define COMMAND_LINE_LABEL 3. @define COMMAND_LINE_OFF 0. @define COMMAND_LINE_ON 1. Abstract : CommandLineHandler { + variables: command-line-string-options (hash). command-line-string-args (hash). command-line-numeric-options (hash). command-line-numeric-args (hash). command-line-on-off-options (hash). command-line-on-off-args (hash). command-line-list-options (hash). command-line-list-args (hash). # Are hash types trivially archived? + to archive: return 1. + to dearchive: return 1. + to finish-with-commandline: free command-line-string-args. free command-line-numeric-args. free command-line-on-off-args. free command-line-list-args. + to get-command-line-string-options: return command-line-string-options. + to get-command-line-numeric-options: return command-line-numeric-options. + to get-command-line-on-off-options: return command-line-on-off-options. + to get-command-line-list-options: return command-line-list-options. + to init: key (string). hashEntry (list). # Command line arguments command-line-string-options{"name"} = {"n","","Experiment name/filename prefix for output:"}. command-line-string-options{"file-path"} = {"fp",FILE_PATH,"Path to save all output files:"}. command-line-string-options{"brain-pool-path"} = {"bpp","","Path to load brain pool from:"}. command-line-string-options{"brain-pool-save"} = {"bps","","Fileset prefix of brain pool files:"}. command-line-string-options{"resume-file"} = {"res-file","","Previously saved log file:"}. command-line-string-options{"auto-resume"} = {"auto-resume","","If filename is given, simulation will resume if file is detected."}. command-line-string-options{"last-path-saved"} = {"last-path-saved","","Last path to which networks were saved."}. command-line-string-options{"last-file-saved"} = {"last-file-saved","","Last file prefix to which networks were saved."}. command-line-string-options{"experiment-theme"} = {"experiment-theme","","Experiment theme (meant to be loaded only):"}. foreach key in keys( command-line-string-options ) : { hashEntry = (command-line-string-options{key}). push (key) onto (hashEntry). command-line-string-args{ hashEntry{COMMAND_LINE_COMMAND} } = hashEntry. } command-line-numeric-options{"mode-age-before-new-add"} = {"mabna",-1,"No new modes if most recent mode is younger than this (-1 = N/A):"}. command-line-numeric-options{"mode-age-before-delete"} = {"mabd",-1,"No mode deletion if most recent mode is younger than this (-1 = N/A):"}. command-line-numeric-options{"eval-limit"} = {"limit",-1,"Terminate simulation after this many evaluations (-1 means N/A):"}. command-line-numeric-options{"goal-size"} = {"gs",1.5,"Size of the goal in ball mode:"}. command-line-numeric-options{"goal-distance"} = {"gd",12,"Distance of goal from ball starting point:"}. command-line-numeric-options{"random-seed-offset"} = {"rso",0,"Amount to add to random seed to get actual random seed:"}. command-line-numeric-options{"player-start-energy"} = {"pse",50,"Amount of health the player has at start of each trial:"}. command-line-numeric-options{"subpop-size"} = {"sp",45,"Size of subpopulations is:"}. command-line-numeric-options{"gens-between-write"} = {"we",50,"Write networks every ith generation where i is:"}. command-line-numeric-options{"max-gens"} = {"max",1000,"Max generations is:"}. command-line-numeric-options{"start-evals"} = {"e",5,"Evals per population is:"}. command-line-numeric-options{"final-eval-multiplier"} = {"fem",10,"Factor increase for number of evals in final gen:"}. command-line-numeric-options{"player-strategy"} = {"s",STRATEGY_SMART,"Player strategy is:"}. command-line-numeric-options{"number-of-subpops"} = {"ns",1,"Number of subpopulations is:"}. command-line-numeric-options{"monsters-from-each-subpop"} = {"mfs",1,"Monsters taken from each subpopulation for an eval is:"}. command-line-numeric-options{"speed-difficulty"} = {"sd",0.0,"Player moves at this portion of full speed:"}. command-line-numeric-options{"children-per-parent"} = {"cpp",1,"Number of children produced for each member of parent population:"}. command-line-numeric-options{"modify-mutation-range"} = {"mmr",0.1,"Range within which mutation rates are modified if they are adaptive:"}. command-line-numeric-options{"new-nn-mode-rate"} = {"nnnmr",0.0,"Probability of adding a new output mode for an NN:"}. command-line-numeric-options{"merge-output-modes-rate"} = {"momr",0.0,"Probability of merging two existing modes:"}. command-line-numeric-options{"demote-mode-rate"} = {"dmr",0.0,"Probability of demoting an output mode:"}. command-line-numeric-options{"delete-mode-rate"} = {"delmr",0.0,"Probability of deleting an output mode (random mutation):"}. command-line-numeric-options{"freeze-rate"} = {"fr",0.0,"Probability of neuron out weights being frozen:"}. command-line-numeric-options{"perturbation-rate"} = {"pr",0.4,"Probability of a mutation that modifies an existing weight:"}. command-line-numeric-options{"new-connection-rate"} = {"ncr",0.2,"Probability of a mutation that creates a new synapse:"}. command-line-numeric-options{"new-input-connection-rate"} = {"nicr",0.0,"Probability of a mutation that connects an input:"}. command-line-numeric-options{"splice-rate"} = {"sr",0.1,"Probability of a mutation that splices a new node along a synapse:"}. command-line-numeric-options{"switch-activation-rate"} = {"sar",0.0,"Probability of a mutation that changes a nodes's activation function:"}. command-line-numeric-options{"merge-nodes-rate"} = {"mnr",0.0,"Probability of a mutation that merges nodes together:"}. command-line-numeric-options{"cascade-node-rate"} = {"cnr",0.0,"Probability of a mutation that adds a cascade node and links:"}. command-line-numeric-options{"crossover-rate"} = {"cr",0.3,"Probability of crossover:"}. command-line-numeric-options{"very-close-monster"} = {"vcm",20,"Radius for sensing other monsters:"}. command-line-numeric-options{"very-close-player"} = {"vcp",9.5,"Radius for sensing the player:"}. command-line-numeric-options{"very-close-sword"} = {"vcs",9.5,"Radius for sensing player's weapon:"}. command-line-numeric-options{"very-close-powerup"} = {"vcpu",9.5,"Radius for sensing powerups:"}. command-line-numeric-options{"very-close-wall"} = {"vcw",9.5,"Radius for sensing walls:"}. command-line-numeric-options{"alpha-dominance"} = {"ad",0.0,"Alpha for alpha-dominance (0.0 means regular dominance is used):"}. command-line-numeric-options{"stagnation-threshold"} = {"st",100000000,"Generations to allow before a stagnation reset:"}. command-line-numeric-options{"stagnation-increment"} = {"si",5,"Generations to modify stagnation threshold by on stagnation:"}. command-line-numeric-options{"eval-iterations"} = {"ei",600,"Iterations within an evaluation:"}. command-line-numeric-options{"cross-breed-percentage"} = {"cbp",0.0,"Chance of mixing offspring from subpopulations:"}. command-line-numeric-options{"soft-goal-achievement-percentage"} = {"sgap",0.9,"Percentage towards goal required for \"soft achievement\":"}. command-line-numeric-options{"hard-goal-achievement-percentage"} = {"hgap",1.1,"Percentage towards goal required for \"hard achievement\":"}. command-line-numeric-options{"desired-ram-group-score"} = {"drgs",50,"Desired group score in ramming mode:"}. command-line-numeric-options{"desired-fight-group-score"} = {"dfgs",50,"Desired group score in fight mode:"}. command-line-numeric-options{"desired-fight-player-score"} = {"dfps",100,"Desired player score in fight mode:"}. command-line-numeric-options{"desired-ram-player-score"} = {"drps",100,"Desired player score in ramming mode:"}. command-line-numeric-options{"desired-pred-group-score"} = {"dpgs",150,"Desired group score in pred mode:"}. command-line-numeric-options{"desired-prey-player-score"} = {"dpps",100,"Desired player score in prey mode:"}. command-line-numeric-options{"desired-pred-ave-assist"} = {"dpaa",175,"Desired average assist score in pred mode:"}. command-line-numeric-options{"desired-pred-portion-confined-time"} = {"dppct",0.66,"Desired portion of eval predators must confine bot:"}. command-line-numeric-options{"desired-fight-ave-assist"} = {"dfaa",75,"Desired average assist score in fight mode:"}. command-line-numeric-options{"desired-fight-ave-received"} = {"dfar",20,"Desired average received score in fight mode:"}. command-line-numeric-options{"desired-ram-ave-received"} = {"drar",20,"Desired average received score in ramming mode:"}. command-line-numeric-options{"desired-prey-ave-received"} = {"dpar",10,"Desired average received score in prey mode:"}. command-line-numeric-options{"desired-fight-portion-time"} = {"dfpt",0.9,"Desired portion of eval to stay alive in fight mode:"}. command-line-numeric-options{"desired-ram-portion-time"} = {"drpt",0.9,"Desired portion of eval to stay alive in ramming mode:"}. command-line-numeric-options{"desired-prey-portion-time"} = {"dppt",0.95,"Desired portion of eval to stay alive in prey mode:"}. command-line-numeric-options{"desired-ball-portion-time"} = {"dbpt",0.33,"Desired portion eval time to sink to goal in ball mode:"}. command-line-numeric-options{"desired-ball-goal-distance"} = {"dbgd",1,"Desired end distance to goal:"}. command-line-numeric-options{"recency-weighted-alpha"} = {"rwa",0.15,"Alpha parameter for adjusting recency weighted averages:"}. command-line-numeric-options{"starting-innovation-number"} = {"inno",1,"Value to start innovation counter at:"}. command-line-numeric-options{"starting-network-id-number"} = {"netid",1,"First unused network id:"}. command-line-numeric-options{"sensor-array-size"} = {"sas",5,"Number of sensors in sensor array:"}. command-line-numeric-options{"sensor-length"} = {"sl",SENSOR_LENGTH,"Length of sensor array sensors:"}. command-line-numeric-options{"ending-generation"} = {"end-gen",0,"Generation on which a loaded simulation previously ended:"}. command-line-numeric-options{"hud-dimension"} = {"hudd",140,"Size of square for the HUD window:"}. command-line-numeric-options{"random-seed"} = {"seed",random[500],"Seed for random number generator:"}. command-line-numeric-options{"home-stretch-generations"} = {"hsg",-1,"Number of generations to evaluate in hardest task (-1 turns off):"}. command-line-numeric-options{"num-output-neurons"} = {"num-output-neurons",2,"Number of neurons in output layer of networks:"}. command-line-numeric-options{"num-burst-mutations"} = {"nbm",20,"Number of mutations for each network with burst mutation:"}. command-line-numeric-options{"num-network-modes"} = {"nnm",0,"Number of distinct output possibilities to choose between:"}. command-line-numeric-options{"switch-every"} = {"se",-1,"Set number of generations between progress jumps (neg means don't use):"}. command-line-numeric-options{"speed-sequence-position"} = {"ssp",0,"Speed in speed sequence to face:"}. command-line-numeric-options{"num-behavior-syllabus-vectors"} = {"nbsv",5,"Number of input vectors for behavior syllabus:"}. command-line-numeric-options{"sword-distance"} = {"sdis",2.0,"Distance in front of player that sword materializes:"}. command-line-numeric-options{"goal-increase-alpha"} = {"gia",0.15,"Parameter for how much goals increase by:"}. command-line-numeric-options{"index-of-last-shaping-objective-added"} = {"ilsoa",0,"Index in list provided to shaping argument:"}. command-line-numeric-options{"prey-speed-ratio"} = {"psr",1.0,"Ration of full speed that prey moves at:"}. command-line-numeric-options{"steps-wo-interaction"} = {"swoi",150,"Time steps with no interaction allowed before early termination:"}. command-line-numeric-options{"goal-achievement-percentage-for-increase"} = {"gapfi",0.5,"Percent of pop. to surpass goal before increasing it:"}. foreach key in keys( command-line-numeric-options ) : { hashEntry = (command-line-numeric-options{key}). push (key) onto (hashEntry). command-line-numeric-args{ hashEntry{COMMAND_LINE_COMMAND} } = hashEntry. } command-line-on-off-options{"promote-solutions-if-variance-allows"}={"psiva",COMMAND_LINE_OFF,"Promote sols to P.front if variance allows:"}. command-line-on-off-options{"pareto-front-first"}={"pff",COMMAND_LINE_OFF,"PartTUG gets the Pareto front first:"}. command-line-on-off-options{"anti-duplicate-partition"}={"adp",COMMAND_LINE_OFF,"PartTUG puts duplicates in lowest priority partition:"}. command-line-on-off-options{"part-tug-goals-use-rwa"}={"ptgrwa",COMMAND_LINE_OFF,"PartTUG uses recency-weighted ave of percent achieving:"}. command-line-on-off-options{"freeze-all-on-mode-add"}={"fama",COMMAND_LINE_OFF,"Freeze all nodes before adding new mode:"}. command-line-on-off-options{"empty-partition-support"}={"sup",COMMAND_LINE_OFF,"Part TUG empty partitions pull from support partitions:"}. command-line-on-off-options{"even-partition-selection"}={"eps",COMMAND_LINE_OFF,"Part TUG selects evenly from each partition:"}. command-line-on-off-options{"always-adjust-part-tug-goals"}={"aaptg",COMMAND_LINE_OFF,"Part TUG goals change every gen, not always up:"}. command-line-on-off-options{"sense-task"}={"sent",COMMAND_LINE_OFF,"Networks have a yes/no sense for each task:"}. command-line-on-off-options{"separate-networks-per-task"}={"snpt",COMMAND_LINE_OFF,"Genome consists of multiple separate networks:"}. command-line-on-off-options{"resave-wo-unused-modes"}={"rwum",COMMAND_LINE_OFF,"Run single gen, then save w/o unused modes:"}. command-line-on-off-options{"predator-switches-direction"}={"psd",COMMAND_LINE_OFF,"Pred switches direction with DODGE strategy:"}. command-line-on-off-options{"delete-mode-mut-removes-least-used"}={"dmrlu",COMMAND_LINE_OFF,"Delete mode mutation removes least used mode:"}. command-line-on-off-options{"delete-mode-del-all-unused"}={"dmdau",COMMAND_LINE_OFF,"Delete mode mutation removes all unused modes:"}. command-line-on-off-options{"switch-task-during-eval"} = {"stde",COMMAND_LINE_OFF,"Task switches in the middle of evaluation:"}. command-line-on-off-options{"lower-bound-certainty-for-achievement"} = {"lbca",COMMAND_LINE_OFF,"Compare goal to (fitness_avg - stdev):"}. command-line-on-off-options{"soft-goal-achievement"} = {"sga",COMMAND_LINE_OFF,"Soft goal achievement allowed for goal increases:"}. command-line-on-off-options{"hard-goal-achievement"} = {"hga",COMMAND_LINE_OFF,"Hard goal achievement required for goal switch-off:"}. command-line-on-off-options{"best-of-brain-pool"} = {"bbp",COMMAND_LINE_OFF,"Pool picks one rep. instead of calculating new outputs:"}. command-line-on-off-options{"inverse-usage-proportionate-mode-deletion"} = {"iupmd",COMMAND_LINE_OFF,"Probabilistically delete modes in proportion to disuse:"}. command-line-on-off-options{"connect-inputs-on-mode-mutation"} = {"inmm",COMMAND_LINE_OFF,"New modes connected to network inputs:"}. command-line-on-off-options{"long-term-averaging"} = {"lta",COMMAND_LINE_OFF,"Scores are averaged across evals in previous generations:"}. command-line-on-off-options{"mode-coloration"} = {"mc",COMMAND_LINE_ON,"Monster colors depend on output mode selection:"}. command-line-on-off-options{"unit-tests"} = {"ut",COMMAND_LINE_OFF,"Perform unit tests then exit:"}. command-line-on-off-options{"adaptive-mutation-rates"} = {"amr",COMMAND_LINE_OFF,"Mutation rates are part of genome, and can change:"}. command-line-on-off-options{"track-mode-usage"} = {"tmu",COMMAND_LINE_ON,"Track information about which output modes agent uses:"}. command-line-on-off-options{"delete-underused-modes"} = {"dum",COMMAND_LINE_OFF,"Delete underused output modes in multimodal nets:"}. command-line-on-off-options{"restrict-similar-modes"} = {"rsm",COMMAND_LINE_OFF,"Prevent new-mode mutation if last mode too similar:"}. command-line-on-off-options{"hide-text"} = {"ht",COMMAND_LINE_OFF,"Hides text on interface:"}. command-line-on-off-options{"focus-on-network-view"} = {"vn",COMMAND_LINE_OFF,"Views the networks instead of the simulation:"}. command-line-on-off-options{"scale-inputs"} = {"scale",COMMAND_LINE_OFF,"Scale NN inputs with sigmoid function:"}. command-line-on-off-options{"random-behavior-syllabus"} = {"rbs",COMMAND_LINE_OFF,"Random syllabus of inputs to define behavior vectors:"}. command-line-on-off-options{"observed-behavior-syllabus"}={"obs",COMMAND_LINE_OFF,"Observed syllabus of inputs to define behavior vectors:"}. command-line-on-off-options{"use-behavior-diversity-fitness"} = {"bd",COMMAND_LINE_OFF,"Behavioral diversity is rewarded:"}. command-line-on-off-options{"min-behavior-diversity"} = {"minbd",COMMAND_LINE_OFF,"Behavioral diversity is min distance instead of avg:"}. command-line-on-off-options{"use-worst-scores"} = {"worst",COMMAND_LINE_OFF,"Fitness scores are mins across all evals instead of averages:"}. command-line-on-off-options{"use-pred-confined-time"} = {"confined",COMMAND_LINE_OFF,"Use Pred Confined Time Fitness:"}. command-line-on-off-options{"new-modes-random-source"} = {"nmrs",COMMAND_LINE_OFF,"New mode mutation nodes have random sources:"}. command-line-on-off-options{"binary-tournament"} = {"bt",COMMAND_LINE_OFF,"Children selected using binary tournament based on front rank:"}. command-line-on-off-options{"show-floor"} = {"floor",COMMAND_LINE_OFF,"Show floor (slows things down):"}. command-line-on-off-options{"cascade-mutate"} = {"cm",COMMAND_LINE_OFF,"Cascade mutation mode:"}. command-line-on-off-options{"decrease-goals-after-stagnation"} = {"dgas",COMMAND_LINE_OFF,"Decrease unachieved goals after stagnation:"}. command-line-on-off-options{"burst-mutation-after-stagnation"} = {"bmas",COMMAND_LINE_OFF,"Burst mutations occur after stagnation:"}. command-line-on-off-options{"easier-after-stagnation"} = {"eas",COMMAND_LINE_OFF,"Decrease difficulty after a stagnation event:"}. command-line-on-off-options{"file-output"} = {"io",COMMAND_LINE_ON,"Send output to file:"}. command-line-on-off-options{"network-output"} = {"net-io",COMMAND_LINE_ON,"Archive network output:"}. command-line-on-off-options{"wrap"} = {"w",COMMAND_LINE_OFF,"Wrapping around edge of environment:"}. command-line-on-off-options{"start-surrounding-player"} = {"ss",COMMAND_LINE_ON,"Starting positions evenly surround the player:"}. command-line-on-off-options{"use-z-scores"} = {"z",COMMAND_LINE_OFF,"Use z-score based fitness combination:"}. command-line-on-off-options{"use-fitness-goals"} = {"fg",COMMAND_LINE_ON,"Use goals for progression based on average fitness scores:"}. command-line-on-off-options{"use-log-goals"} = {"lg",COMMAND_LINE_OFF,"Use goals for progression based on logged scores:"}. command-line-on-off-options{"mating"} = {"mate",COMMAND_LINE_OFF,"Use crossover:"}. command-line-on-off-options{"use-walls"} = {"walls",COMMAND_LINE_OFF,"Use walls:"}. command-line-on-off-options{"use-power-ups"} = {"powerups",COMMAND_LINE_OFF,"Use power-ups:"}. command-line-on-off-options{"progress"} = {"progress",COMMAND_LINE_ON,"Progress to greater challenges when goals are met:"}. command-line-on-off-options{"fs-net"} = {"fs",COMMAND_LINE_ON,"Start with feature selective neural networks:"}. command-line-on-off-options{"action-selector-net"} = {"as",COMMAND_LINE_OFF,"Neural networks are action selectors (not raw controllers):"}. command-line-on-off-options{"make-movie"} = {"movie",COMMAND_LINE_OFF,"Make movies at task transitions (requires display):"}. command-line-on-off-options{"discrete-movement"} = {"dm",COMMAND_LINE_ON,"Discrete forward/backward movements:"}. command-line-on-off-options{"discrete-turns"} = {"dt",COMMAND_LINE_OFF,"Discrete turning actions:"}. command-line-on-off-options{"task-progression"} = {"tp",COMMAND_LINE_OFF,"Progress by changing player strategy:"}. command-line-on-off-options{"keep-parents"} = {"p",COMMAND_LINE_ON,"Parents can proceed to the next generation:"}. command-line-on-off-options{"teamwork"} = {"tw",COMMAND_LINE_ON,"Monsters sense each other:"}. command-line-on-off-options{"index-based-senses"} = {"ib",COMMAND_LINE_OFF,"Monsters have access to index-based senses:"}. command-line-on-off-options{"personal-awareness"} = {"pa",COMMAND_LINE_ON,"Monsters have access to personal stimuli senses:"}. command-line-on-off-options{"group-awareness"} = {"ga",COMMAND_LINE_ON,"Monsters have access to personal stimuli senses of the group:"}. command-line-on-off-options{"random-sampling"} = {"rs",COMMAND_LINE_OFF,"Monster teams selected via random sampling:"}. command-line-on-off-options{"use-disks"} = {"disks",COMMAND_LINE_OFF,"Disks under monsters indicate sense range:"}. command-line-on-off-options{"draw-lines"} = {"lines",COMMAND_LINE_OFF,"Lines connect objects within each monster's \"neighborhood\":"}. command-line-on-off-options{"absence-negative"} = {"an",COMMAND_LINE_ON,"Lack of stimuli is -1 instead of 0:"}. command-line-on-off-options{"homogeneous"} = {"homo",COMMAND_LINE_OFF,"Homogeneous groups (every monster has same brain):"}. command-line-on-off-options{"distance-senses"} = {"ds",COMMAND_LINE_OFF,"Use senses for continuous distance perception:"}. command-line-on-off-options{"close-player-senses"} = {"cps",COMMAND_LINE_OFF,"Use coarse senses for proximity to player:"}. command-line-on-off-options{"bias-senses"} = {"bias",COMMAND_LINE_ON,"Use constant input bias sense:"}. command-line-on-off-options{"anyone-close-senses"} = {"ac",COMMAND_LINE_OFF,"Inform monsters when anyone is close to the player:"}. command-line-on-off-options{"player-front-sensor"} = {"pfs",COMMAND_LINE_ON,"Tell Monster if it is in front of the player:"}. command-line-on-off-options{"random-fitness"} = {"rf",COMMAND_LINE_OFF,"Random fitness score for debugging/diversity:"}. command-line-on-off-options{"anti-bloat-fitness"} = {"abf",COMMAND_LINE_OFF,"Fitness score that punishes having too many network nodes:"}. command-line-on-off-options{"mode-restricting-fitness"} = {"mrf",COMMAND_LINE_OFF,"Fitness score punishes having too many output modes:"}. command-line-on-off-options{"unused-mode-restricting-fitness"} = {"umrf",COMMAND_LINE_OFF,"Punishes unused output modes:"}. command-line-on-off-options{"facing-senses"} = {"face",COMMAND_LINE_OFF,"Use senses for when one agent is facing another:"}. command-line-on-off-options{"stay-bound"} = {"sb",COMMAND_LINE_ON,"Pred trials end if player is not within monster bounding box:"}. command-line-on-off-options{"early-termination"} = {"et",COMMAND_LINE_ON,"Trials end early if no interaction occurs:"}. command-line-on-off-options{"HUD"} = {"hud",COMMAND_LINE_OFF,"Whether or not to show Heads-Up Display of networks:"}. command-line-on-off-options{"inverse-distance-sensors"} = {"ids",COMMAND_LINE_OFF,"Sensor array uses inverse distance sensors:"}. command-line-on-off-options{"random-player-orientation"} = {"rpo",COMMAND_LINE_ON,"Player faces a random direction when spawning:"}. command-line-on-off-options{"front-load-sensors"} = {"fls",COMMAND_LINE_ON,"Sensors are bunched at fron instead of spread evenly:"}. command-line-on-off-options{"stick-sensors"} = {"sstick",COMMAND_LINE_ON,"Sensors for the stick in fight mode:"}. command-line-on-off-options{"targeting-unachieved-goals"} = {"tug",COMMAND_LINE_OFF,"Defeated objectives do not affect selection:"}. command-line-on-off-options{"constraint-based-tug"} = {"ctug",COMMAND_LINE_OFF,"TUG treats goals as constraints:"}. command-line-on-off-options{"partition-tug"} = {"parttug",COMMAND_LINE_OFF,"TUG partitions objective space based on goal achievement:"}. command-line-on-off-options{"invisible-sensors"} = {"invs",COMMAND_LINE_ON,"Sensors are invisible:"}. command-line-on-off-options{"sensor-array-only"} = {"sao",COMMAND_LINE_OFF,"Only use the sensor array as input:"}. command-line-on-off-options{"smart-swing"} = {"sswing",COMMAND_LINE_OFF,"Bot swings as soon as monsters are in range:"}. command-line-on-off-options{"player-shoots"} = {"ps",COMMAND_LINE_OFF,"Fight bot shoots bullets instead of swinging stick:"}. command-line-on-off-options{"predefined-network-modes"} = {"pnm",COMMAND_LINE_OFF,"Network has a set mode for each game mode:"}. command-line-on-off-options{"non-deterministic-mode-selection"} = {"ndms",COMMAND_LINE_OFF,"Preference nodes indicate probability of mode being selected:"}. command-line-on-off-options{"open-ended-evolution"} = {"oee",COMMAND_LINE_OFF,"Only end when max gens is met, not before:"}. command-line-on-off-options{"increase-goals-when-all-achieved"} = {"igwaa",COMMAND_LINE_OFF,"When all goals are met at hardest difficulty, increase goals:"}. command-line-on-off-options{"increase-goal-when-turned-on"} = {"igwto",COMMAND_LINE_OFF,"Increase goal of any objective that has just been turned on:"}. foreach key in keys( command-line-on-off-options ) : { hashEntry = (command-line-on-off-options{key}). push (key) onto (hashEntry). command-line-on-off-args{ hashEntry{COMMAND_LINE_COMMAND} } = hashEntry. } #command-line-list-options{"task-set"} = {"task-set",{MODE_FIGHT, MODE_PREY, MODE_PRED, MODE_BALL},"The tasks to evolve against"}. command-line-list-options{"task-set"} = {"task-set",{MODE_FIGHT},"The tasks to evolve against: "}. command-line-list-options{"preferred-point"} = {"pref",{},"Preferred point to evolve to"}. command-line-list-options{"speed-sequence"} = {"speed-sequence",{0.0,0.4,0.8,0.9,0.95,1.0},"Sequence of speed challenges (end with 1.0):"}. command-line-list-options{"previous-fitness-average-averages"} = {"prev-fit-ave-aves",{},"Fitness moving averages of averages from last save:"}. command-line-list-options{"previous-fitness-best-averages"} = {"prev-fit-best-aves",{},"Fitness moving averages of best from last save:"}. command-line-list-options{"previous-achieving-percentage-aves"} = {"prev-ach-perc-aves",{},"Percent achieving moving aves from last save:"}. command-line-list-options{"fitness-shaping"} = {"shaping",{},"Add these fitnesses in sequence for fitness shaping: "}. foreach key in keys( command-line-list-options ) : { hashEntry = (command-line-list-options{key}). push (key) onto (hashEntry). command-line-list-args{ hashEntry{COMMAND_LINE_COMMAND} } = hashEntry. } + to num-param named label (string): if !(command-line-numeric-options{label}) : { print "label $label does not exist". controller end-simulation. return. } return (command-line-numeric-options{label}{COMMAND_LINE_VAL}). + to set-num-param named label (string) to value (double): if !(command-line-numeric-options{label}) : { print "label $label does not exist". controller end-simulation. return. } command-line-numeric-options{label}{COMMAND_LINE_VAL} = value. + to bit-param named label (string): if !(command-line-on-off-options{label}) : { print "label $label does not exist". controller end-simulation. return. } return (command-line-on-off-options{label}{COMMAND_LINE_VAL}). + to set-bit-param named label (string) to value (int): if !(command-line-on-off-options{label}) : { print "label $label does not exist". controller end-simulation. return. } command-line-on-off-options{label}{COMMAND_LINE_VAL} = value. + to string-param named label (string): if !(command-line-string-options{label}) : { print "label $label does not exist". controller end-simulation. return. } return (command-line-string-options{label}{COMMAND_LINE_VAL}). + to set-string-param named label (string) to value (string): if !(command-line-string-options{label}) : { print "label $label does not exist". controller end-simulation. return. } command-line-string-options{label}{COMMAND_LINE_VAL} = value. + to list-param named label (string): if !(command-line-list-options{label}) : { print "label $label does not exist". controller end-simulation. return. } return (command-line-list-options{label}{COMMAND_LINE_VAL}). + to string-list-param named label (string): result (list). tempString (string). i (int). result = (self list-param named label). for i = 0, i < |result|, i++ : { tempString = result{i}. tempString{0} = "". result{i} = "$tempString". } return result. + to set-list-param named label (string) to value (list): if !(command-line-list-options{label}) : { print "label $label does not exist". controller end-simulation. return. } command-line-list-options{label}{COMMAND_LINE_VAL} = value. + to set-string-list-param named label (string) to value (list): i (int). tempString (string). for i = 0, i < |value|, i++: { tempString = value{i}. value{i} = ":$tempString". } self set-list-param named label to value. # arg: command-line-string-args{arg} exists (command line arg) # val: an appropriate string + to assign-command-line-string-val of val (string) to arg (string) : hashEntry (list). hashEntry = command-line-string-args{arg}. hashEntry{COMMAND_LINE_VAL} = val. print hashEntry{COMMAND_LINE_EXPLAIN},hashEntry{COMMAND_LINE_VAL}. # arg: command-line-numeric-args{arg} exists (command line arg) # tempDouble: an appropriate numeric value + to assign-command-line-numeric-val of tempDouble (double) to arg (string) : hashEntry (list). hashEntry = command-line-numeric-args{arg}. hashEntry{COMMAND_LINE_VAL} = tempDouble. print hashEntry{COMMAND_LINE_EXPLAIN},hashEntry{COMMAND_LINE_VAL}. # arg: command-line-on-off-args{arg} exists (command line arg) # val: "on" or "off" + to assign-command-line-on-off-val of val (string) to arg (string) : hashEntry (list). temp (int). hashEntry = command-line-on-off-args{arg}. if val == "on" : hashEntry{COMMAND_LINE_VAL} = COMMAND_LINE_ON. else if val == "off" : hashEntry{COMMAND_LINE_VAL} = COMMAND_LINE_OFF. else { print "Unexpected argument: $val". controller end-simulation. return. } temp = hashEntry{COMMAND_LINE_VAL}. print hashEntry{COMMAND_LINE_EXPLAIN},(self to-on-off of temp). # arg: command-line-numeric-args{arg} exists (command line arg) # tempDouble: an appropriate numeric value + to assign-command-line-list-val of tempList (list) to arg (string) : hashEntry (list). hashEntry = command-line-list-args{arg}. hashEntry{COMMAND_LINE_VAL} = tempList. print hashEntry{COMMAND_LINE_EXPLAIN},hashEntry{COMMAND_LINE_VAL}. + to num-arg named arg (string): return command-line-numeric-args{ arg }. + to string-arg named arg (string): return command-line-string-args{ arg }. + to bit-arg named arg (string): return command-line-on-off-args{ arg }. + to list-arg named arg (string): return command-line-list-args{ arg }. # bit: COMMAND_LINE_ON or COMMAND_LINE_OFF + to to-on-off of bit (int): if bit : return "ON". else return "OFF". }