📄 environment.html
字号:
are "xored" together in a bitwise fashion, and the result is output. The xor operation stands for "exclusive or" and returns a one if one, but not both, of the inputs is a one. Otherwise a zero is returned.<tr><td><font color="#0000AA">equ </font> <td>This task is triggered when two 32 bit numbers are input, the values are equated together in a bitwise fashion, and the result is output. The equ operation stands for "equals" and will return a one if both bits are identical, and a zero if they are different.<tr><td><font color="#0000AA">logic_3AA-<br> logic_3CP</font> <td>These tasks include all 68 possible unique 3-input logic operations, many of which don't have easy-to-understand human readable names.</table><p>When describing a reaction, the "process" portion determines consumptionof resources, their byproducts, and the resulting bonuses. There areseveral arguments (separated by colons; example below) to detail the use of aresource. Default values are in brackets:<p><p align=center><b>Table 3: <font color="#004400">Reaction Process Specifications</font></b><table cellpadding=4 border=2><tr><th>Argument <th>Description <th>Default<tr><td><font color="#0000AA">resource</font> <td>The name of the resource consumed. By default, no resource is being consumed, and the 'max' limit is the amount absorbed. <td>infinite<tr><td><font color="#0000AA">value</font> <td>Multiply the value set here by the amount of the resource consumed to obtain the bonus. (0.5 may be inefficient, while 5.0 is very efficient.) This allows different reactions to make use of the same resource at different efficiency levels. <td>1.0<tr><td><font color="#0000AA">type</font> <td>Determines how to apply the bonus (i.e. the amount of the resource absorbed times the value of this process) to change the merit of the organism.<br> <b>add</b>: Directly add the bonus to the current merit.<br> <b>mult</b>: Multiply the current merit by the bonus (warning: if the bonus is ever less than one, this will be detrimental!)<br> <b>pow</b>: Multiply the current merit by 2<sup>bonus</sup>. this is effectively multiplicative, but positive bonuses are always beneficial, and negative bonuses are harmful.<br> <td>add<tr><td><font color="#0000AA">max</font> <td>The maximum amount of the resource consumed per occurrence. <td>1.0<tr><td><font color="#0000AA">min</font> <td>The minimum amount of resource required. If less than this quantity is available, the reaction ceases to proceed. <td>0.0<tr><td><font color="#0000AA">frac</font> <td>The maximum fraction of the available resource that can be consumed. <td>1.0<tr><td><font color="#0000AA">product</font> <td>The name of the by-product resource. At the moment, only a single by-product can be produced at a time. <td>none<tr><td><font color="#0000AA">conversion</font> <td>The conversion rate to by-product resource <td>1.0</table><p>If no process is given, a single associated process with all defaultsettings is assumed. If multiple process statements are given, <i>all</i> areacted upon when the reaction is triggered. Assuming you were going to setall of the portions of process to be their default values, this portion ofthe reaction statement would appear as:<pre> process:resource=infinite:value=1:type=add:max=1:min=0:frac=1:product=none:conversion=1</pre><p>This statement has many redundancies; for example, it would indicate that theassociated reaction should use the inifite resource, making 'frac' and 'min'settings irrelevant. Likewise, since 'product' is set to none, the'conversion' rate is never considered.<p>The "requisite" entry limits when this reaction can be triggered. Thefollowing requisites (in any combination) are possible:<p><p align=center><b>Table 4: <font color="#004400">Reaction Requisite Specifications</font></b><table cellpadding=4 border=2><tr><th>Argument <th>Description <th>Default<tr><td><font color="#0000AA">reaction</font> <td>This limits this reaction from being triggered until the other reaction specified here has been triggered first. With this, the user can force organisms to perform reactions in a specified order. <td>none<tr><td><font color="#0000AA">noreaction</font> <td>This limits this reaction from being triggered if the reaction specified here has already been triggered. This allows the user to make mutually exclusive reactions, and force organisms to "choose" their own path. <td>none<tr><td><font color="#0000AA">min_count</font> <td>This restriction requires that the task used to trigger this reaction must be performed a certain number of times before the trigger will actually occur. This (along with max_count) allows the user to provide different reactions depending on the number of times an organism has performed a task. <td>0<tr><td><font color="#0000AA">max_count</font> <td>This restriction places a cap on the number of times a task can be done and still trigger this reaction. It allows the user to limit the number of times a reaction can be done, as well as (along with min_count) provide different reactions depending on the number of times an organism as performed a task. <td>INT_MAX</table><p>No restrictions are present by default. If there are multiple requisite entries, only *one* of them need be satisfied in order to trigger thereaction. Note though that a single requisite entry can have as manyportions as needed.<p>EXAMPLES:<p>We could simulate the pre-environment system (in which no resources werepresent and task performace was rewarded with a fixed bonus) with a fileincluding only lines like:<p> REACTION AND logic:2a process:type=mult:value=4.0 requisite:max_count=1<br> REACTION EQU logic:2h process:type=mult:value=32.0 requisite:max_count=1<br><p>No RESOURCE statements need be included since only the infinite resource isused (by default, since we don't specify another resources' name)# To create an environment with two resources that are converted back andforth as tasks are performed, we might have:<p> RESOURCE yummyA:initial=1000<br> RESOURCE yummyB:initial=1000<br> REACTION AtoB gobbleA process:resource=yummyA:frac=0.001:product=yummyB<br> REACTION BtoA gobbleB process:resource=yummyB:frac=0.001:product=yummyA<br><p>A value of 1.0 per reaction is default. Obviously "gobbleA" and "gobbleB"would have to be tasks described within avida.<p>A requisite against the other reaction being performed would prevent asingle organism from garnering both rewards in equal measure.<p>As an example, to simulate a chemostat, we might have:<br><p> RESOURCE glucose:inflow=100:outflow=0.01<p>This would create a resource called "glucose" that has a fixed inflow rate of10000 units where 20% flows out every update. (Leaving a steady state of50,000 units if no organism-consumption occurs).<p>Limitations to this system:<menu><li>Resources are currently all global; at some point soon we need to implement local resources.<li>Only a single resource can be required at a time, and only a single by-product can be produced.<li>Events to affect resources have not yet been implemented.</menu><p>The default setup is:<pre> REACTION NOT not process:value=1.0:type=pow requisite:max_count=1 REACTION NAND nand process:value=1.0:type=pow requisite:max_count=1 REACTION AND and process:value=2.0:type=pow requisite:max_count=1 REACTION ORN orn process:value=2.0:type=pow requisite:max_count=1 REACTION OR or process:value=3.0:type=pow requisite:max_count=1 REACTION ANDN andn process:value=3.0:type=pow requisite:max_count=1 REACTION NOR nor process:value=4.0:type=pow requisite:max_count=1 REACTION XOR xor process:value=4.0:type=pow requisite:max_count=1 REACTION EQU equ process:value=5.0:type=pow requisite:max_count=1</pre><p>This creates an environment where the organisms get a bonus for performingany of nine tasks. Since none of the reactions are associated with aresource, the infinite resource is assumed, which is non-depeleatable.The max_count of one means they can only get the bonus from each reactiona single time.<p>A similar setup that has 9 resources, one corresponding to each of the ninepossible tasks listed above is:<pre> RESOURCE resNOT:inflow=100:outflow=0.01 resNAND:inflow=100:outflow=0.01 RESOURCE resAND:inflow=100:outflow=0.01 resORN:inflow=100:outflow=0.01 RESOURCE resOR:inflow=100:outflow=0.01 resANDN:inflow=100:outflow=0.01 RESOURCE resNOR:inflow=100:outflow=0.01 resXOR:inflow=100:outflow=0.01 RESOURCE resEQU:inflow=100:outflow=0.01 REACTION NOT not process:resource=resNOT:value=1.0:frac=0.0025 REACTION NAND nand process:resource=resNAND:value=1.0:frac=0.0025 REACTION AND and process:resource=resAND:value=2.0:frac=0.0025 REACTION ORN orn process:resource=resORN:value=2.0:frac=0.0025 REACTION OR or process:resource=resOR:value=4.0:frac=0.0025 REACTION ANDN andn process:resource=resANDN:value=4.0:frac=0.0025 REACTION NOR nor process:resource=resNOR:value=8.0:frac=0.0025 REACTION XOR xor process:resource=resXOR:value=8.0:frac=0.0025 REACTION EQU equ process:resource=resEQU:value=16.0:frac=0.0025</pre>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -