sdleiF | tnemirepxE | ||
int running0 .. 1 (false/true) | Is the simulation running?Useful for synchronizing the user interface state. | ||
int time | Number of stepsSimulator.time will be removed because of its misleading name, please use Simulator.stepNumber instead. | ||
int last_genotype_num0 .. -1 default=0 | Largest previously used Genotype.numSee: Genotype.num | ||
int last_creature_num0 .. -1 default=0 | Largest previously used Creature.numSee: Creature.num | ||
int stepNumber | Number of simulation steps | ||
int simspeed RO | Simulation speedsteps/second | ||
string expdef | Experiment definitionChoose the experiment framework (in Windows GUI, confirm by pressing 'Apply') Stop the simulation before selecting another experiment definition. It is a good practice to initialize the experiment before running the simulation. | ||
string expdef_title RO | Title | ||
multiline string expdef_info RO | Description | ||
untyped lastCheckpoint RO | Last checkpointMost recently reported by the experiment definition script. | ||
SlaveSimulators slaves RO | Slave simulator objects | ||
int cpus RO | Number of detected CPUs ("cores") on this machine | ||
World world RO | World object | ||
Populations populations RO | Populations object | ||
GenePools genepools RO | Gene pools object | ||
ExpProperties expproperties RO | ExpProperties | ||
ExpState expstate RO | ExpState | ||
GenMan genman RO | GenMan object | ||
GenoConverters genoconverters RO | Genotype converters object | ||
untyped userdata | User field | ||
int identity RO | Identity-1 for master simulator, 0...count-1 for slaves | ||
string version_string RO | Version stringCurrent application version as a string (human-friendly). | ||
int version_int RO | Version integerCurrent application version as an integer. | ||
seliF | |||
int autosaveperiod0 .. 100000 | Save backupSave simulation state once every n-th event (events are defined by the script. For 'standard.expdef' it is after each death). Save EXPT file first to initialize name for autosave files. Slave simulators (in multithreaded experiments) ignore this setting and never create autosave files. | ||
int overwrite0 .. 1 (false/true) default=0 | Overwrite files?Lets you choose what to do when a file is created with the same name as an already existing file: overwite the existing file or create its backup? | ||
int filecomm0 .. 1 (false/true) default=1 | Show file commentsControls displaying comments encountered in opened files. | ||
gnitpircs decnavdA | |||
multiline string usercode | Script overrideYou can override any function from the original experiment definition script. Use the same function names and provide alternative implementations. Example: function onBorn(cr) { Simulator.print("A creature is born: "+cr.name); super_onBorn(cr); //calls the original implementation } | ||
int vmdebug0 .. 1 (false/true) | VM debug | ||
int vm_step_limit0 .. 1000000000 default=0 | VM step limitAbort any script (expdef, fitness formula, user script) when it performs too many operations - which can take more or less time depending on your machine performance. This can protect against infinite loops or unbearably long runs of untested scripts that would otherwise force you to kill the whole application. Use Simulator.vm_..._warning if you only need information about what script takes too much time without aborting it. | ||
int vm_step_warning0 .. 1000000000 default=0 | VM step warningDisplay a warning when any script (expdef, fitness formula, user script) performs too many operations - which can take more or less time depending on your machine performance. Use Simulator.vm_..._limit to prevent the application from becoming unresponsive by aborting misbehaving scripts. | ||
float vm_time_limit0 .. 1e+09 default=0.0 | VM time limitAbort any script (expdef, fitness formula, user script) when it takes too much time - measured in seconds. The actual amount of work depends on your machine performance. This can protect against infinite loops or unbearably long runs of untested scripts that would otherwise force you to kill the whole application. Use Simulator.vm_..._warning if you only need information about what script takes too much time without aborting it. | ||
float vm_time_warning0 .. 1e+09 default=0.0 | VM time warningDisplay a warning when any script (expdef, fitness formula, user script) takes too much time - measured in seconds. The actual amount of work depends on your machine performance. Use Simulator.vm_..._limit to prevent the application from becoming unresponsive by aborting misbehaving scripts. | ||
gnildnah rorrE | |||
int stop_on0 .. 3 | Error level to stop running simulationIf the simulation is running and a message is emitted with at least the selected severity, the simulation will be stopped. | ||
int createrr0 .. 2 | Object creation errors | ||
int groupchk0 .. 1 (false/true) default=1 | Warn on adding invalid genotypesWarnings will be printed when invalid genotypes are added to a gene pool. | ||
int creatwarnfail0 .. 1 (false/true) | Don't simulate genotypes with warningsCreatures grown with warnings will not be simulated. This helps prevent the propagation of faulty genes, because genotypes that cause warnings when interpreted will not reproduce. | ||
snoitcnuF | |||
function beep()doesn't return a value | BeepPlays the default system sound. | ||
function checkpoint()doesn't return a value | Notify that the experiment state was significantly updated.This function was previously called "autosave". | ||
function checkpointData(untyped any_data)doesn't return a value | Notify that the experiment state was significantly updated + pass data.In the distributed/paralellized scenario the data passed as argument can be received by the controlling entity (onSlaveCheckpoint in multithreaded master experiment, /simulator/expevent in distributed network simulator). | ||
function eval(string script_statement)doesn't return a value | Evaluate a statementThe argument must be a complete statement, e.g. "return 2+2;" is valid, while "2+2" is not. The Error object is returned for invalid statements. Example: var statement="function fun(a) {return a*a;} return fun(Math.pi);"; var result=Simulator.eval(statement); if (typeof result=="Error") Simulator.print("Error:"+result.message); else Simulator.print("Result:"+result); | ||
function export(string filename, int options, int genepool, int population)returns untyped | ExportSave some data to file. Arguments: - filename: can be null, which makes export() return saved data as a text string instead of writing it to the file. - options: composed of the following bit values: 1 - experiment (works just like save() and all other option bits are ignored) 2 - genotypes 4 - simulator parameters 8 - simulator stats 16 - genepool settings 32 - population settings 64 - do autosave 256 - creatures - selected genepool, -1 means all genepools - selected population, -1 means all populations | ||
function import(string filename, int options)doesn't return a value | importImport some data from file. Contents can also be imported from string by using specifically formed filename: "string://string_contents_to_be_imported". The second optional argument selects what section(s) will be imported: 1 - experiment (works just like load(), all other bits are ignored, and can reset the simulator state!) 2 - genotypes 4 - simulator parameters 8 - genepool settings 16 - population settings 32 - new groups will be created for imported genepools and populations 64 - allow switching to a different expdef while importing parameters (4) 256 - creatures The standard behavior (without the second argument) is to import genotypes, parameters, and genepool and population settings (2+4+8+16). Note that "64" is not included by default, because the expdef change resets all simulator parameters, which contradicts the usual meaning of "import" in Framsticks ("add data", as opposed to "load" meaning "replace data"). Moreover, using the "64" option in scripts can be dangerous, especially all expdef and show scripts should always declare the proper expdef name in their header rather than change the expdef directly. Without the "64" option, it is always safe to "import" any file in a script regardless of the current simulator state. | ||
function import(string filename)doesn't return a value | ImportEquivalent to import(filename,2+4+8+16) - imports genotypes, parameters, genepool and population settings. | ||
function init()doesn't return a value | Initialize experimentPrepares the experiment for running - usually performs initialization procedures such as resetting counters, states, gene pools, etc. These actions are defined in the onInit() function of this experiment definition. | ||
function load(string filename)doesn't return a value | loadLoad experiment file (calls onExpLoad() in the current experiment definition). This function is intended to replace the simulator state; the old state is cleared by automatically calling "resetToDefaults()". Use "import" if you don't want to lose the old simulator state. Contents can also be loaded from string by using specifically formed filename: "string://string_contents_to_be_loaded". | ||
function loadexpdef()doesn't return a value | Reload experiment definitionResets the simulator to its default state, resets all parameters to default values and then loads this experiment definition. | ||
function message(string text, int level)doesn't return a value | Print messageThe second argument can be: -1 = debugging message 0 = information 1 = warning 2 = error 3 = critical error | ||
function new()returns Simulator | create new Simulator | ||
function print(string text)doesn't return a value | Print information messageOne argument: message to be printed. | ||
function refreshGUI()doesn't return a value | Refresh GUINotify that all populations and gene pools content changed. | ||
function reloadNeurons()doesn't return a value | Reload neuron definitions | ||
function resetToDefaults()doesn't return a value | Reset the simulator stateClears groups and loads default values for simulator parameters, then calls onExpDefLoad() of the current experiment definition. | ||
function save(string filename)returns untyped | SaveSave experiment file (calls onExpSave() in the current experiment definition). Providing null filename makes save() return saved data as a text string instead of writing it to the file. | ||
function sleep(int milliseconds)doesn't return a value | SleepSuspends the execution for a specified interval. | ||
function sound(int freqency_in_Hz, int length_in_milliseconds)doesn't return a value | SoundGenerates a simple tone on the speaker | ||
function start()doesn't return a value | Start simulationCalled by the user interface. | ||
function step()doesn't return a value | Do a single simulation step | ||
function stop()doesn't return a value | Stop simulationThe expdef script calls this function to stop simulation. |
Global context |