|
| 1 | +{ |
| 2 | + "Body": { |
| 3 | + "prefix": "body", |
| 4 | + "body": [ |
| 5 | + "body ${1:Name} {", |
| 6 | + " sensor ${2:name}: internal(0..1)", |
| 7 | + " sensor ${3:nearby}: directional(range: ${4:20}, directions: 4)", |
| 8 | + "", |
| 9 | + " actuator ${5:move}: directional(threshold: 0.5, directions: 4)", |
| 10 | + " actuator ${6:act}: trigger(threshold: 0.5)", |
| 11 | + "}" |
| 12 | + ], |
| 13 | + "description": "Define an agent body with sensors and actuators" |
| 14 | + }, |
| 15 | + "Sensor Internal": { |
| 16 | + "prefix": "sensor-internal", |
| 17 | + "body": [ |
| 18 | + "sensor ${1:name}: internal(0..1)" |
| 19 | + ], |
| 20 | + "description": "Internal state sensor (one brain input node)" |
| 21 | + }, |
| 22 | + "Sensor Directional": { |
| 23 | + "prefix": "sensor-directional", |
| 24 | + "body": [ |
| 25 | + "sensor ${1:name}: directional(range: ${2:20}, directions: 4)" |
| 26 | + ], |
| 27 | + "description": "Directional sensor (4 brain input nodes: N/S/E/W)" |
| 28 | + }, |
| 29 | + "Sensor Item Property": { |
| 30 | + "prefix": "sensor-property", |
| 31 | + "body": [ |
| 32 | + "sensor ${1:name}: item_property(${2:field})" |
| 33 | + ], |
| 34 | + "description": "Item property sensor (nearest item's observable property)" |
| 35 | + }, |
| 36 | + "Sensor Social": { |
| 37 | + "prefix": "sensor-social", |
| 38 | + "body": [ |
| 39 | + "sensor ${1:peer_health}: social(${2:health})" |
| 40 | + ], |
| 41 | + "description": "Social sensor (peer agent's visible state, requires agents: 2)" |
| 42 | + }, |
| 43 | + "Actuator Directional": { |
| 44 | + "prefix": "actuator-directional", |
| 45 | + "body": [ |
| 46 | + "actuator ${1:move}: directional(threshold: ${2:0.5}, directions: 4)" |
| 47 | + ], |
| 48 | + "description": "Directional actuator (4 brain output nodes, winner-take-all)" |
| 49 | + }, |
| 50 | + "Actuator Trigger": { |
| 51 | + "prefix": "actuator-trigger", |
| 52 | + "body": [ |
| 53 | + "actuator ${1:act}: trigger(threshold: ${2:0.5})" |
| 54 | + ], |
| 55 | + "description": "Trigger actuator (fires when activation exceeds threshold)" |
| 56 | + }, |
| 57 | + "Item": { |
| 58 | + "prefix": "item", |
| 59 | + "body": [ |
| 60 | + "item ${1:Name} {", |
| 61 | + " category: ${2:resource}", |
| 62 | + " properties {", |
| 63 | + " ${3:color}: ${4:0.5}", |
| 64 | + " }", |
| 65 | + " on_consume {", |
| 66 | + " ${5:energy}: ${6:+0.3}", |
| 67 | + " }", |
| 68 | + "}" |
| 69 | + ], |
| 70 | + "description": "Define an item with observable properties and hidden effects" |
| 71 | + }, |
| 72 | + "World": { |
| 73 | + "prefix": "world", |
| 74 | + "body": [ |
| 75 | + "world ${1:Name} {", |
| 76 | + " size: ${2:10} x ${3:10}", |
| 77 | + " walls: border", |
| 78 | + " item_respawn: ${4:30} ticks", |
| 79 | + " spawn ${5:resource}: ${6:4}", |
| 80 | + "}" |
| 81 | + ], |
| 82 | + "description": "Define a world grid with item spawning" |
| 83 | + }, |
| 84 | + "Fitness": { |
| 85 | + "prefix": "fitness", |
| 86 | + "body": [ |
| 87 | + "fitness ${1:Name} {", |
| 88 | + " maximize survival: ${2:10.0}", |
| 89 | + " maximize ${3:health}: ${4:5.0}", |
| 90 | + " reward ${5:collected}: ${6:2.0}", |
| 91 | + " penalize ${7:idle}: ${8:1.0}", |
| 92 | + " penalize complexity: 0.001", |
| 93 | + "}" |
| 94 | + ], |
| 95 | + "description": "Define fitness objectives (what success looks like)" |
| 96 | + }, |
| 97 | + "Evolve": { |
| 98 | + "prefix": "evolve", |
| 99 | + "body": [ |
| 100 | + "evolve ${1:Name} {", |
| 101 | + " body: ${2:AgentBody}", |
| 102 | + " items: [${3:Item1, Item2}]", |
| 103 | + " world: ${4:WorldName}", |
| 104 | + " fitness: ${5:FitnessName}", |
| 105 | + "", |
| 106 | + " population: ${6:200}", |
| 107 | + " generations: ${7:1000}", |
| 108 | + " scenarios: ${8:5}", |
| 109 | + " ticks: ${9:300}", |
| 110 | + " seed: ${10:42}", |
| 111 | + " agents: ${11:1}", |
| 112 | + "}" |
| 113 | + ], |
| 114 | + "description": "Define an evolution experiment" |
| 115 | + }, |
| 116 | + "Evolve with Mutation": { |
| 117 | + "prefix": "evolve-full", |
| 118 | + "body": [ |
| 119 | + "evolve ${1:Name} {", |
| 120 | + " body: ${2:AgentBody}", |
| 121 | + " items: [${3:Item1, Item2}]", |
| 122 | + " world: ${4:WorldName}", |
| 123 | + " fitness: ${5:FitnessName}", |
| 124 | + "", |
| 125 | + " population: ${6:200}", |
| 126 | + " generations: ${7:1000}", |
| 127 | + " scenarios: ${8:5}", |
| 128 | + " ticks: ${9:300}", |
| 129 | + " seed: ${10:42}", |
| 130 | + " agents: ${11:1}", |
| 131 | + "", |
| 132 | + " mutation {", |
| 133 | + " weight_shift: 0.8", |
| 134 | + " bias_shift: 0.1", |
| 135 | + " add_connection: 0.05", |
| 136 | + " remove_connection: 0.03", |
| 137 | + " add_node: 0.03", |
| 138 | + " remove_node: 0.01", |
| 139 | + " rewire: 0.02", |
| 140 | + " change_activation: 0.01", |
| 141 | + " }", |
| 142 | + "", |
| 143 | + " speciation {", |
| 144 | + " threshold: 3.0", |
| 145 | + " target_species: 15", |
| 146 | + " stagnation: 15 generations", |
| 147 | + " }", |
| 148 | + "", |
| 149 | + " convergence {", |
| 150 | + " plateau: 200 generations", |
| 151 | + " threshold: 0.5", |
| 152 | + " }", |
| 153 | + "", |
| 154 | + " checkpoint {", |
| 155 | + " every: 100 generations", |
| 156 | + " keep: 3", |
| 157 | + " }", |
| 158 | + "}" |
| 159 | + ], |
| 160 | + "description": "Define an evolution experiment with all optional blocks" |
| 161 | + }, |
| 162 | + "Mutation Block": { |
| 163 | + "prefix": "mutation", |
| 164 | + "body": [ |
| 165 | + "mutation {", |
| 166 | + " weight_shift: ${1:0.8}", |
| 167 | + " bias_shift: ${2:0.1}", |
| 168 | + " add_connection: ${3:0.05}", |
| 169 | + " remove_connection: ${4:0.03}", |
| 170 | + " add_node: ${5:0.03}", |
| 171 | + " remove_node: ${6:0.01}", |
| 172 | + " rewire: ${7:0.02}", |
| 173 | + " change_activation: ${8:0.01}", |
| 174 | + "}" |
| 175 | + ], |
| 176 | + "description": "Mutation rate configuration block" |
| 177 | + }, |
| 178 | + "Speciation Block": { |
| 179 | + "prefix": "speciation", |
| 180 | + "body": [ |
| 181 | + "speciation {", |
| 182 | + " threshold: ${1:3.0}", |
| 183 | + " target_species: ${2:15}", |
| 184 | + " stagnation: ${3:15} generations", |
| 185 | + "}" |
| 186 | + ], |
| 187 | + "description": "Speciation configuration block" |
| 188 | + }, |
| 189 | + "Convergence Block": { |
| 190 | + "prefix": "convergence", |
| 191 | + "body": [ |
| 192 | + "convergence {", |
| 193 | + " plateau: ${1:200} generations", |
| 194 | + " threshold: ${2:0.5}", |
| 195 | + "}" |
| 196 | + ], |
| 197 | + "description": "Convergence detection block" |
| 198 | + }, |
| 199 | + "Checkpoint Block": { |
| 200 | + "prefix": "checkpoint", |
| 201 | + "body": [ |
| 202 | + "checkpoint {", |
| 203 | + " every: ${1:100} generations", |
| 204 | + " keep: ${2:3}", |
| 205 | + "}" |
| 206 | + ], |
| 207 | + "description": "Checkpoint save configuration" |
| 208 | + } |
| 209 | +} |
0 commit comments