# Log output file # Log.tz (c) 2010 Jacob Schrum. # See Simulation.tz for more copyright information @use Abstract. @use File. # Log File @define LOG_SLOT_LABEL 0. @define LOG_SLOT_METHOD 1. @define LOG_SLOT_AVE 2. @define LOG_SLOT_RESET 3. @define LOG_SLOT_GOAL_TYPE 4. @define LOG_SLOT_GOAL 5. @define LOG_SLOT_VALUE 6. @define LOG_SLOT_LINK 7. @define LOG_SLOT_ARGS 8. # Link plots @define LINK_ON 1. @define LINK_OFF 0. # Goals @define GOAL_NONE 0. @define GOAL_OVER 1. @define GOAL_UNDER 2. @define GOAL_OUTSIDE 3. @define GOAL_INSIDE 4. Abstract : Log { + variables: log-file (object). log-objects (list). populations-logged (int). file-path (string). commandline (object). + to archive: return 1. + to dearchive: log-file = new File. return 1. + to init: log-file = new File. populations-logged = 0. log-objects = {}. commandline = (controller get-commandline). # this-path: path to output data to + to set-path to this-path (string): file-path = this-path. + to get-populations-logged: return populations-logged. + to increment-populations-logged: populations-logged++. # Log objects are now completely maintained by Log instead of passed in as before. # # # items: list of items to maintain log information about # # {name,method name,child moving average,reset value,goal type,goal spec,parent moving average} #+ to assign-log-list of items (list): # log-objects = items. + to get-log-objects: return log-objects. # fitness-info-list: list with infor about each objective in the simulation # {best,worst,method name,name,best moving average,worst moving average,game mode, # population average,moving average of the population average,goal to reach,min/reset,goal on/off} + to write-headers using fitness-info-list (list) to-file file-prefix (string): plot-file (object). tempList (list). temp (string). temp2 (string). i (int). col (int). bs (string). end (string). log-goal (int). tug (int). tug = (commandline bit-param named "targeting-unachieved-goals"). bs = "\\ ". bs{1} = "". plot-file = new File. plot-file open-for-writing with-file "$file-path/$file-prefix.plot". plot-file write-line text "set style data linespoints". end = "". col = 1. temp2 = "#". for i = 0, i < |log-objects|, i++ : { temp = log-objects{i}{LOG_SLOT_LABEL}. if (|log-objects{i}{LOG_SLOT_ARGS}| > 0) : { tempList = log-objects{i}{LOG_SLOT_ARGS}. temp = "$temp$tempList". } if (end == "") : plot-file write-line text "plot $bs". log-goal = ((log-objects{i}{LOG_SLOT_GOAL_TYPE} != GOAL_NONE) && (commandline bit-param named "use-log-goals")). if (log-goal) : { plot-file write-line text "\"$file-path/$file-prefix.txt\" using $col title \"$file-prefix $temp GOAL\", $bs". temp2 = "$temp2$temp GOAL\t". col++. } end = "". if (log-objects{i}{LOG_SLOT_LINK} || log-goal) : end = ", $bs". plot-file write-line text "\"$file-path/$file-prefix.txt\" using $col title \"$file-prefix $temp\"$end". temp2 = "$temp2$temp\t". col++. if (log-goal) : { end = "". if (log-objects{i}{LOG_SLOT_LINK}) : end = ", $bs". plot-file write-line text "\"$file-path/$file-prefix.txt\" using $col title \"$file-prefix $temp AVE\"$end". } temp2 = "$temp2$temp AVE\t". col++. if (!log-objects{i}{LOG_SLOT_LINK}) : { plot-file write-line text "". plot-file write-line text "pause -1". plot-file write-line text "". } } for i=0, i<|fitness-info-list|, i++ : { temp = fitness-info-list{i}{SLOT_DISPLAY_LABEL}. plot-file write-line text "plot $bs". if fitness-info-list{i}{SLOT_USE_GOAL} == FITNESS_GOAL_ON : { plot-file write-line text "\"$file-path/$file-prefix.txt\" using $col title \"$file-prefix $temp GOAL\", $bs". temp2 = "$temp2$temp GOAL\t". col++. } plot-file write-line text "\"$file-path/$file-prefix.txt\" using $col title \"$file-prefix $temp USE\", $bs". temp2 = "$temp2$temp USE\t". col++. plot-file write-line text "\"$file-path/$file-prefix.txt\" using $col title \"$file-prefix $temp BEST\", $bs". temp2 = "$temp2$temp B\t". col++. if tug : { plot-file write-line text "\"$file-path/$file-prefix.txt\" using $col title \"$file-prefix $temp BEST_AVE\", $bs". } temp2 = "$temp2$temp B_AVE\t". col++. plot-file write-line text "\"$file-path/$file-prefix.txt\" using $col title \"$file-prefix $temp AVE\", $bs". temp2 = "$temp2$temp AVE\t". col++. if tug : { plot-file write-line text "\"$file-path/$file-prefix.txt\" using $col title \"$file-prefix $temp AVE_AVE\", $bs". } temp2 = "$temp2$temp AVE_AVE\t". col++. end = "". if tug : end = ", $bs". plot-file write-line text "\"$file-path/$file-prefix.txt\" using $col title \"$file-prefix $temp WORST\"$end". temp2 = "$temp2$temp W\t". col++. if tug : { plot-file write-line text "\"$file-path/$file-prefix.txt\" using $col title \"$file-prefix $temp WORST_AVE\"". } temp2 = "$temp2$temp W_AVE\t". col++. plot-file write-line text "". plot-file write-line text "pause -1". plot-file write-line text "". plot-file write-line text "plot $bs". plot-file write-line text "\"$file-path/$file-prefix.txt\" using $col title \"$file-prefix $temp PercentAchieving\", $bs". col++. plot-file write-line text "\"$file-path/$file-prefix.txt\" using $col title \"$file-prefix $temp PercentAchieving AVE\"". plot-file write-line text "". plot-file write-line text "pause -1". plot-file write-line text "". temp2 = "$temp2$temp PercentAchieving\t". temp2 = "$temp2$temp PercentAchieving AVE\t". col++. } plot-file close. free plot-file. log-file open-for-writing with-file "$file-path/$file-prefix.txt". log-file write-line text temp2. log-file close. # old: full file path to a log file with simulation data to resume from # - Call after writing headers to the current log file + to copy-previous-file named old (string) to-file file-prefix (string): line (string). buffer (string). old-file (object). old-file = new File. old-file open-for-reading with-file old. #Throw away headers old-file read-line. buffer = "". log-file open-for-appending with-file "$file-path/$file-prefix.txt". while !(old-file is-end-of-file) : { line = old-file read-line. buffer = "$buffer$line\n". if (|line| > 0) && (line{0} == "#") : # Presence of a # signifies that networks were written { log-file write text buffer. buffer = "". } } log-file close. old-file close. # fitness-info-list: list with infor about each objective in the simulation # {best,worst,method name,name,best moving average,worst moving average,game mode, # population average,moving average of the population average,goal to reach,min/reset,goal on/off} + to log-data using fitness-info-list (list) to-file file-prefix (string): i (int). tempDouble (double). temp (string). temp = "". for i = 0, i < |log-objects|, i++ : { if (log-objects{i}{LOG_SLOT_GOAL_TYPE} != GOAL_NONE) && (commandline bit-param named "use-log-goals") : { tempDouble = log-objects{i}{LOG_SLOT_GOAL}. temp = "$temp$tempDouble\t". } tempDouble = log-objects{i}{LOG_SLOT_VALUE}. temp = "$temp$tempDouble\t". tempDouble = (log-objects{i}{LOG_SLOT_AVE}). temp = "$temp$tempDouble\t". } for i=0, i<|fitness-info-list|, i++ : { if fitness-info-list{i}{SLOT_USE_GOAL} == FITNESS_GOAL_ON : { #if fitness-info-list{i}{SLOT_USE_OBJECTIVE} == FITNESS_OBJECTIVE_ON : tempDouble = fitness-info-list{i}{SLOT_GOAL}. #else # tempDouble = fitness-info-list{i}{SLOT_MIN}. temp = "$temp$tempDouble\t". } tempDouble = fitness-info-list{i}{SLOT_USE_OBJECTIVE}. temp = "$temp$tempDouble\t". tempDouble = fitness-info-list{i}{SLOT_CURRENT_BEST_FITNESS}. temp = "$temp$tempDouble\t". tempDouble = fitness-info-list{i}{SLOT_BEST_AVE}. temp = "$temp$tempDouble\t". tempDouble = fitness-info-list{i}{SLOT_CURRENT_AVE}. temp = "$temp$tempDouble\t". tempDouble = fitness-info-list{i}{SLOT_CURRENT_AVE_AVE}. temp = "$temp$tempDouble\t". tempDouble = fitness-info-list{i}{SLOT_CURRENT_WORST_FITNESS}. temp = "$temp$tempDouble\t". tempDouble = fitness-info-list{i}{SLOT_WORST_AVE}. temp = "$temp$tempDouble\t". tempDouble = fitness-info-list{i}{SLOT_PERCENT_ACHIEVING_GOAL}. temp = "$temp$tempDouble\t". tempDouble = fitness-info-list{i}{SLOT_PERCENT_ACHIEVING_GOAL_AVE}. temp = "$temp$tempDouble\t". } self log-to-file text temp to-file file-prefix. + to log-to-file text s (string) to-file file-prefix (string): log-file open-for-appending with-file "$file-path/$file-prefix.txt". log-file write-line text s. log-file close. + to update-log-averages: i (int). alpha (double). alpha = (commandline num-param named "recency-weighted-alpha"). for i=0, i<|log-objects|, i++ : { log-objects{i}{LOG_SLOT_VALUE} = (controller call-method named (log-objects{i}{LOG_SLOT_METHOD}) with-arguments (log-objects{i}{LOG_SLOT_ARGS})). log-objects{i}{LOG_SLOT_AVE} += alpha * ((log-objects{i}{LOG_SLOT_VALUE}) - (log-objects{i}{LOG_SLOT_AVE})). } + to reset-log-averages: i (int). for i=0, i<|log-objects|, i++ : { log-objects{i}{LOG_SLOT_AVE} = log-objects{i}{LOG_SLOT_RESET}. } + to check-goals: return (self check-goals-ave for-slot LOG_SLOT_AVE). + to check-goals-ave for-slot slot (int): i (int). failed (int). failed = 0. for i=0, i<|log-objects|, i++ : { if (log-objects{i}{LOG_SLOT_GOAL_TYPE} == GOAL_OVER) && (log-objects{i}{slot} < log-objects{i}{LOG_SLOT_GOAL}) : failed++. else if (log-objects{i}{LOG_SLOT_GOAL_TYPE} == GOAL_UNDER) && (log-objects{i}{slot} > log-objects{i}{LOG_SLOT_GOAL}) : failed++. else if (log-objects{i}{LOG_SLOT_GOAL_TYPE} == GOAL_OUTSIDE) && (log-objects{i}{LOG_SLOT_GOAL}{0} < log-objects{i}{slot}) && (log-objects{i}{slot} < log-objects{i}{LOG_SLOT_GOAL}{1}) : failed++. else if (log-objects{i}{LOG_SLOT_GOAL_TYPE} == GOAL_INSIDE) && ((log-objects{i}{LOG_SLOT_GOAL}{0} > log-objects{i}{slot}) || (log-objects{i}{slot} > log-objects{i}{LOG_SLOT_GOAL}{1})) : failed++. } # Return 1 if all goals are met if failed > 0 : return 0. else return 1. # Managing the fitness-info-list + to get-new-fitness-info-entry method m (string) label l (string) game-mode mode (int) goal g (double) minimum minval (double) use-goal ug (int) use-objective uo (int) success-level sl = 0.0 (double): return {minval,minval,m,l,0,0,mode,0.0,0.0,g,minval,ug,{},uo,sl,0.0,0.0,0,0.0,0.0}. + to include-fitness named fitness (string) on-or-off use-objective = 1 (int): if (fitness == "FightAssist") :{ return (self get-new-fitness-info-entry method "get-damage-assist-fitness" label "FightAssist" game-mode MODE_FIGHT goal (commandline num-param named "desired-fight-ave-assist") minimum 0.0 use-goal FITNESS_GOAL_ON use-objective use-objective). }else if (fitness == "FightGroup") : { return (self get-new-fitness-info-entry method "get-group-score-fitness" label "FightGroup" game-mode MODE_FIGHT goal (commandline num-param named "desired-fight-group-score") minimum 0.0 use-goal FITNESS_GOAL_ON use-objective use-objective). }else if (fitness == "FightInflicted") : { return (self get-new-fitness-info-entry method "get-damage-inflicted-fitness" label "FightInflicted" game-mode MODE_FIGHT goal 0.0 minimum 0.0 use-goal FITNESS_GOAL_OFF use-objective use-objective). }else if (fitness == "PredAssist") : { return (self get-new-fitness-info-entry method "get-damage-assist-fitness" label "PredAssist" game-mode MODE_PRED goal (commandline num-param named "desired-pred-ave-assist") minimum 0.0 use-goal FITNESS_GOAL_ON use-objective use-objective). }else if (fitness == "PredGroup") : { return (self get-new-fitness-info-entry method "get-group-score-fitness" label "PredGroup" game-mode MODE_PRED goal (commandline num-param named "desired-pred-group-score") minimum 0.0 use-goal FITNESS_GOAL_ON use-objective use-objective). }else if (fitness == "PredInflicted") : { return (self get-new-fitness-info-entry method "get-damage-inflicted-fitness" label "PredInflicted" game-mode MODE_PRED goal 0.0 minimum 0.0 use-goal FITNESS_GOAL_OFF use-objective use-objective). }else if (fitness == "RamGroup") : { return (self get-new-fitness-info-entry method "get-group-score-fitness" label "RamGroup" game-mode MODE_RAM goal (commandline num-param named "desired-ram-group-score") minimum 0.0 use-goal FITNESS_GOAL_ON use-objective use-objective). }else if (fitness == "BackRamGroup") : { return (self get-new-fitness-info-entry method "get-group-score-fitness" label "BackRamGroup" game-mode MODE_BACKRAM goal (commandline num-param named "desired-ram-group-score") minimum 0.0 use-goal FITNESS_GOAL_ON use-objective use-objective). }else if (fitness == "PreyReceived") : { return (self get-new-fitness-info-entry method "get-damage-received-fitness" label "PreyReceived" game-mode MODE_PREY goal (- (commandline num-param named "desired-prey-ave-received")) minimum (- MONSTER_START_ENERGY) use-goal FITNESS_GOAL_ON use-objective use-objective). }else if (fitness == "FightReceived") : { return (self get-new-fitness-info-entry method "get-damage-received-fitness" label "FightReceived" game-mode MODE_FIGHT goal (- (commandline num-param named "desired-fight-ave-received")) minimum (- MONSTER_START_ENERGY) use-goal FITNESS_GOAL_ON use-objective use-objective). }else if (fitness == "RamReceived") : { return (self get-new-fitness-info-entry method "get-damage-received-fitness" label "RamReceived" game-mode MODE_RAM goal (- (commandline num-param named "desired-ram-ave-received")) minimum (- MONSTER_START_ENERGY) use-goal FITNESS_GOAL_ON use-objective use-objective). }else if (fitness == "BackRamReceived") : { return (self get-new-fitness-info-entry method "get-damage-received-fitness" label "BackRamReceived" game-mode MODE_BACKRAM goal (- (commandline num-param named "desired-ram-ave-received")) minimum (- MONSTER_START_ENERGY) use-goal FITNESS_GOAL_ON use-objective use-objective). }else if (fitness == "PreyAlive") : { return (self get-new-fitness-info-entry method "get-iterations-alive" label "PreyAlive" game-mode MODE_PREY goal ((commandline num-param named "desired-prey-portion-time") * (commandline num-param named "eval-iterations")) minimum 0.0 use-goal FITNESS_GOAL_ON use-objective use-objective). }else if (fitness == "FightAlive") : { return (self get-new-fitness-info-entry method "get-iterations-alive" label "FightAlive" game-mode MODE_FIGHT goal ((commandline num-param named "desired-fight-portion-time") * (commandline num-param named "eval-iterations")) minimum 0.0 use-goal FITNESS_GOAL_ON use-objective use-objective). }else if (fitness == "RamAlive") : { return (self get-new-fitness-info-entry method "get-iterations-alive" label "RamAlive" game-mode MODE_RAM goal ((commandline num-param named "desired-ram-portion-time") * (commandline num-param named "eval-iterations")) minimum 0.0 use-goal FITNESS_GOAL_ON use-objective use-objective). }else if (fitness == "BackRamAlive") : { return (self get-new-fitness-info-entry method "get-iterations-alive" label "BackRamAlive" game-mode MODE_BACKRAM goal ((commandline num-param named "desired-ram-portion-time") * (commandline num-param named "eval-iterations")) minimum 0.0 use-goal FITNESS_GOAL_ON use-objective use-objective). }else if (fitness == "PredTimeConfined") : { return (self get-new-fitness-info-entry method "get-iterations-confined" label "PredTimeConfined" game-mode MODE_PRED goal ((commandline num-param named "desired-pred-portion-confined-time") * (commandline num-param named "eval-iterations")) minimum 0.0 use-goal FITNESS_GOAL_ON use-objective use-objective). }else if (fitness == "BallGoalTime") : { return (self get-new-fitness-info-entry method "get-negative-iterations-alive" label "BallGoalTime" game-mode MODE_BALL goal (- ((commandline num-param named "desired-ball-portion-time") * (commandline num-param named "eval-iterations"))) minimum (- (commandline num-param named "eval-iterations")) use-goal FITNESS_GOAL_ON use-objective use-objective). }else if (fitness == "BallGoalDistance") : { return (self get-new-fitness-info-entry method "get-goal-distance-fitness" label "BallGoalDistance" game-mode MODE_BALL goal (- (commandline num-param named "desired-ball-goal-distance")) minimum (- LONG_DISTANCE_TO_GOAL) use-goal FITNESS_GOAL_ON use-objective use-objective). }else if (fitness == "BehavioralDiversity") : { return (self get-new-fitness-info-entry method "dummy-fitness" label "BehavioralDiversity" game-mode GAME_MODE_ALL goal 0.0 minimum 0.0 use-goal FITNESS_GOAL_OFF use-objective use-objective). }else if (fitness == "Random") : { return (self get-new-fitness-info-entry method "get-random-fitness" label "Random" game-mode GAME_MODE_ALL goal 0.0 minimum 0.0 use-goal FITNESS_GOAL_OFF use-objective use-objective). }else if (fitness == "AntiBloat") : { return (self get-new-fitness-info-entry method "get-anti-bloat-fitness" label "AntiBloat" game-mode GAME_MODE_ALL goal 0.0 minimum 0.0 use-goal FITNESS_GOAL_OFF use-objective use-objective). }else if (fitness == "ModeRestrict") : { return (self get-new-fitness-info-entry method "get-output-mode-restricting-fitness" label "ModeRestrict" game-mode GAME_MODE_ALL goal 0.0 minimum 0.0 use-goal FITNESS_GOAL_OFF use-objective use-objective). }else if (fitness == "UnusedModeRestrict") : { return (self get-new-fitness-info-entry method "punish-unused-modes" label "UnusedModeRestrict" game-mode GAME_MODE_ALL goal 0.0 minimum 0.0 use-goal FITNESS_GOAL_OFF use-objective use-objective). }else { print "Unrecognized fitness: $fitness". self end-simulation. return. } # Managing log-objects + to add-log-object named label (string) with-args args (list) inputs additional-input-info (list): push (self get-log-object named label with-args args inputs additional-input-info) onto log-objects. + to new-log-object label l (string) method m (string) reset r (double) goal-type gt (int) goal g (double) join link (int) args a (list): return {l,m,0.0,r,gt,g,0.0,link,a}. + to get-log-object named label (string) with-args args (list) inputs additional-input-info (list): link (int). temp (string). tempList (list). if (label == "AveGroupPredScore") : { return (self new-log-object label "AveGroupPredScore" method "get-ave-group-pred-score" reset 0.0 goal-type GOAL_OVER goal (commandline num-param named "desired-pred-group-score") join LINK_OFF args args). } else if (label == "AvePlayerPreyScore") : { return (self new-log-object label "AvePlayerPreyScore" method "get-ave-player-prey-score" reset PLAYER_START_AVE goal-type GOAL_NONE goal (commandline num-param named "desired-prey-player-score") join LINK_OFF args args). } else if (label == "AveGroupFightScore") : { return (self new-log-object label "AveGroupFightScore" method "get-ave-group-fight-score" reset 0.0 goal-type GOAL_OVER goal (commandline num-param named "desired-fight-group-score") join LINK_OFF args args). } else if (label == "AveGroupRamScore") : { return (self new-log-object label "AveGroupRamScore" method "get-ave-group-ram-score" reset 0.0 goal-type GOAL_OVER goal (commandline num-param named "desired-ram-group-score") join LINK_OFF args args). } else if (label == "AveGroupBackRamScore") : { return (self new-log-object label "AveGroupBackRamScore" method "get-ave-group-back-ram-score" reset 0.0 goal-type GOAL_OVER goal (commandline num-param named "desired-ram-group-score") join LINK_OFF args args). } else if (label == "AvePlayerFightScore") : { return (self new-log-object label "AvePlayerFightScore" method "get-ave-player-fight-score" reset PLAYER_START_AVE goal-type GOAL_NONE goal (commandline num-param named "desired-fight-player-score") join LINK_OFF args args). } else if (label == "AvePlayerRamScore") : { return (self new-log-object label "AvePlayerRamScore" method "get-ave-player-ram-score" reset PLAYER_START_AVE goal-type GOAL_NONE goal (commandline num-param named "desired-ram-player-score") join LINK_OFF args args). } else if (label == "AvePlayerBackRamScore") : { return (self new-log-object label "AvePlayerBackRamScore" method "get-ave-player-back-ram-score" reset PLAYER_START_AVE goal-type GOAL_NONE goal (commandline num-param named "desired-ram-player-score") join LINK_OFF args args). } else if (label == "Strategy") : { return (self new-log-object label "Strategy" method "get-player-strategy" reset 0.0 goal-type GOAL_NONE goal 0 join LINK_OFF args args). } else if (label == "Speed") : { return (self new-log-object label "Speed" method "get-speed-difficulty" reset 0.0 goal-type GOAL_NONE goal 0 join LINK_OFF args args). } else if (label == "ParetoFrontSize") : { return (self new-log-object label "ParetoFrontSize" method "get-last-pareto-front-size" reset 0.0 goal-type GOAL_NONE goal 0 join LINK_ON args args). } else if (label == "SuccessfulIndividuals") : { return (self new-log-object label "SuccessfulIndividuals" method "get-num-successful" reset 0.0 goal-type GOAL_NONE goal 0 join LINK_OFF args args). } else if (label == "AverageOutputModes") : { return (self new-log-object label "AverageOutputModes" method "get-average-num-net-modes" reset 0.0 goal-type GOAL_NONE goal 0 join LINK_ON args args). } else if (label == "MaxOutputModes") : { return (self new-log-object label "MaxOutputModes" method "get-max-num-net-modes" reset 0.0 goal-type GOAL_NONE goal 0 join LINK_ON args args). } else if (label == "MinOutputModes") : { return (self new-log-object label "MinOutputModes" method "get-min-num-net-modes" reset 0.0 goal-type GOAL_NONE goal 0 join LINK_OFF args args). } else if (label == "AverageParentAge") : { return (self new-log-object label "AverageParentAge" method "get-ave-age" reset 0.0 goal-type GOAL_NONE goal 0 join LINK_ON args args). } else if (label == "MaxParentAge") : { return (self new-log-object label "MaxParentAge" method "get-max-age" reset 0.0 goal-type GOAL_NONE goal 0 join LINK_ON args args). } else if (label == "MinParentAge") : { return (self new-log-object label "MinParentAge" method "get-min-age" reset 0.0 goal-type GOAL_NONE goal 0 join LINK_OFF args args). } else if (label == "AvePercentModeUsage") : { return (self new-log-object label "AvePercentModeUsage" method "get-ave-percent-mode-usage" reset 0.0 goal-type GOAL_NONE goal 0 join LINK_OFF args args). } else if (label == "TotalNodes") : { return (self new-log-object label "TotalNodes" method "get-total-free-nodes" reset 0.0 goal-type GOAL_NONE goal 0 join LINK_OFF args args). } else if (label == "RatioChildren") : { return (self new-log-object label "RatioChildren" method "get-ratio-children-in-new-pop" reset 0.0 goal-type GOAL_NONE goal 0 join LINK_OFF args args). } else if (label == "GoalIncrease") : { return (self new-log-object label "GoalIncrease" method "just-increased-goals" reset 0.0 goal-type GOAL_NONE goal 0 join LINK_OFF args args). } else if (label == "Generation") : { return (self new-log-object label "Generation" method "get-generation" reset 0.0 goal-type GOAL_NONE goal 0 join LINK_OFF args args). } else if (label == "MinPrefPointDistance") : { return (self new-log-object label "MinPrefPointDistance" method "get-min-preferred-point-distance" reset 0.0 goal-type GOAL_NONE goal 0 join LINK_OFF args args). } else if (label == "Promotions") : { return (self new-log-object label "Promotions" method "get-promotions" reset 0.0 goal-type GOAL_NONE goal 0 join LINK_OFF args args). } else if (label == "InputUsage" || (label{0} == "U" && label{1} == "s" && label{2} == "a" && label{3} == "g" && label{4} == "e")) : { link = LINK_OFF. temp = additional-input-info{(args{0})}{INPUT_SLOT_METHOD}. tempList = additional-input-info{(args{0})}{INPUT_SLOT_ARGS}. temp = "$temp$tempList". return (self new-log-object label "Usage:$temp" method "get-input-connectivity" reset 0.0 goal-type GOAL_NONE goal 0 join link args args). } else if (label == "PartitionSize") : { return (self new-log-object label "PartitionSize" method "get-size-of-tug-partition" reset 0.0 goal-type GOAL_NONE goal 0 join LINK_ON args args). } else if (label == "PartitionTaken") : { return (self new-log-object label "PartitionTaken" method "get-num-taken-from-partition" reset 0.0 goal-type GOAL_NONE goal 0 join LINK_OFF args args). } else { print "Not a valid log object: $label". controller end-simulation. return. } }