├── .gitignore ├── README.md ├── LICENSE └── TankLogo.nlogo /.gitignore: -------------------------------------------------------------------------------- 1 | # General 2 | .DS_Store 3 | .AppleDouble 4 | .LSOverride 5 | 6 | # Icon must end with two \r 7 | Icon 8 | .TankLogo_01.tmp.nlogo 9 | 10 | # Thumbnails 11 | ._* 12 | 13 | # Files that might appear in the root of a volume 14 | .DocumentRevisions-V100 15 | .fseventsd 16 | .Spotlight-V100 17 | .TemporaryItems 18 | .Trashes 19 | .VolumeIcon.icns 20 | .com.apple.timemachine.donotpresent 21 | 22 | # Directories potentially created on remote AFP share 23 | .AppleDB 24 | .AppleDesktop 25 | Network Trash Folder 26 | Temporary Items 27 | .apdisk 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TankLogo 2 | [![platform](https://img.shields.io/badge/platform-netlogo-blue.svg)](https://shields.io/) [![contributions](https://img.shields.io/badge/contributions-welcome-green.svg)](https://github.com/huangyz0918/TankNetLogo) 3 | 4 | A tank war strategy built by [NetLogo](https://ccl.northwestern.edu/netlogo/). Share your ideas and strategies and win the game! 5 | 6 | Want to have a try? See [demo](http://www.netlogoweb.org/launch#https://raw.githubusercontent.com/huangyz0918/TankLogo/master/TankLogo.nlogo). 7 | 8 | ![](https://i.loli.net/2018/10/17/5bc6eeb182cf0.png) 9 | 10 | You can see two kinds of tank here: 11 | - The Red one 12 | - The Blue one 13 | 14 | In this project, the red tank has a temporary strongest strategy, which means it is very strong and you may lose it easily. You can not modify the code of the red one, but you can modify the blue one, and make it better than the red one. 15 | 16 | __If you have made your blue tank stronger than the red tank__, You win! :collision: 17 | 18 | You can submit your tank strategy (yours blue tank code) through a [pull request](https://yangsu.github.io/pull-request-tutorial/), and we will update our red tank code according to your blue tank code until there is another better blue tank to beat yours. During this time, your github id and avatar will displaied in the `README.md` [here](https://github.com/huangyz0918/TankLogo#current-winner). 19 | 20 | It's like a game of fighting, let's cheer, the first place is yours! 21 | 22 | 23 | ## What's NetLogo? 24 | You can checkout for more information at it's [homepage](https://ccl.northwestern.edu/netlogo/). 25 | 26 | Here is the definition of NetLogo programming language from [wikipedia](https://en.wikipedia.org/wiki/NetLogo): 27 | 28 | > NetLogo was designed, by Uri Wilensky, in the spirit of the Logo programming language, to be "low threshold and no ceiling". It teaches programming concepts using agents in the form of turtles, patches, links and the observer. NetLogo was designed for multiple audiences in mind, in particular: teaching children in the education community, and for domain experts without a programming background to model related phenomena. Many scientific articles have been published using NetLogo. 29 | 30 | After all, it's a very easy programming language which can let you focus more on the programming logic of our battles. 31 | 32 | ## How to get start? 33 | - Install NetLogo in your machine or using the [NetLogo Web](http://www.netlogoweb.org/launch#https://raw.githubusercontent.com/huangyz0918/TankLogo/master/TankLogo.nlogo). 34 | - Open the `TankLogo.nlogo` file (upload to the web server or double click in your computer). 35 | - See the UI, and click the `setup` button, and you can see the yellow boundary which means the wall. 36 | - Type a name for the red tank (or the blue one) in the `TankName` (input box), and click `create tank` button. 37 | - Type another name for the another tank in `TankName` (input box), and click `create tank` button to create it. 38 | - Use button `run` to begin the battle, use `reset` button to restart a game. 39 | 40 | 41 | ## The Tank Battle Strategy 42 | 43 | ![](https://i.loli.net/2018/10/17/5bc6c7486353e.png) 44 | 45 | Introduction to the UI: 46 | 47 | - The `setup` button: Initialize the user interface. 48 | - The `reset` button: Reset the war. 49 | - The `go` button: Start animation and confrontation. 50 | - You can use the `TankName` to put a name for your tank before creating it. 51 | - You can set the `FirePower` through the progress bar, which is the power of per bullet. 52 | - If you want to watch the track of tanks, you can set the `LeaveTrack?` to `on`. 53 | 54 | The finite element state machine was used for the core part of this tank war game. We set the default status to `status-forward[v]` , `status-dodge-forward[args]` or `status-random-forward[tickNum]`, they have diffierent characteristics and downsides: 55 | 56 | - In the status `status-forward[v]`, the tank will use the `v` as it's velocity to move forward. 57 | - In status `status-back`, `status-right`, `status-left` and `status-stop`, the tank will go back, turn right/left and just stop. 58 | - `status-random-forward[tickNum]` allows the tank to move forward at a random direction in a fixed time interval, which is can be set by input paramemter `tickNum`. 59 | - `status-dodge-forward[args]` is a pretty tricky status, if other tank shooting by aiming at your tank, the best dodge strategy is to move in a direction perpendicular to its direction of motion, since the bullet has a delay before hitting yours. 60 | 61 | 62 | ## Contribution Guides 63 | 64 | The NetLogo is a pretty easy programming language, we wish you can get start as soon as possible, so if you have any question about NetLogo, please check out for the official [document](http://ccl.northwestern.edu/netlogo/docs/index2.html). 65 | 66 | In this project, the only area you can modify are marked in the code via comments, you cannot make any changes related to the red tank, or we wouldn't accept your PR and update yours strategy. 67 | 68 | In your code, you can not modify the opponent's attributes, such as resetting the health and velocity of the red tank, but you can detect others' attributes. For example, you can detect the patch of the red code using `patch-here`. 69 | 70 | To do some contributions, you need to install NetLogo firstly then clone your fork, double click the `TankLogo.nlogo` and run! 71 | 72 | ## FAQ 73 | Why choose NetLogo as programming language? 74 | > Because NetLogo is quite easy and there are less people know how to use it than other languages, so if you want to get start, everybody is equal. 75 | 76 | How can I get start ? 77 | > Two steps, the first is install NetLogo. The second one is clone this repo and double click the `.nlogo` file and improve the tank. 78 | 79 | How can I get if I win your tank ? 80 | > The best tank will update according to your solution, and your Github avatar and name will display until somebody beats yours. 81 | 82 | How to submit my solution ? 83 | > Fork this repo and improve your code, test if it can really win the red tank, submit a pull request, done! 84 | 85 | If I don't want to install NetLogo, how can I get start? 86 | > You can use [NetLogo Web](http://www.netlogoweb.org/launch#https://raw.githubusercontent.com/huangyz0918/TankLogo/master/TankLogo.nlogo) to run your code. 87 | 88 | 91 | 94 | 95 | 96 | ## Licence 97 | 98 | ``` 99 | Copyright 2018 Yizheng Huang 100 | 101 | Licensed under the Apache License, Version 2.0 (the "License"); 102 | you may not use this file except in compliance with the License. 103 | You may obtain a copy of the License at 104 | 105 | http://www.apache.org/licenses/LICENSE-2.0 106 | 107 | Unless required by applicable law or agreed to in writing, software 108 | distributed under the License is distributed on an "AS IS" BASIS, 109 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 110 | See the License for the specific language governing permissions and 111 | limitations under the License. 112 | 113 | ``` 114 | 115 | 116 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /TankLogo.nlogo: -------------------------------------------------------------------------------- 1 | ;; ================================================================================================ 2 | ;; =================================== Don't make changes here ==================================== 3 | ;; ================================================================================================ 4 | breed [redTanks redTank] 5 | breed [blueTanks blueTank] 6 | breed [turrets turret] 7 | breed [bullets bullet] 8 | 9 | redTanks-own [ 10 | ;;Users should not set the values of these variables in the code---------- 11 | name ;;Name of the tank 12 | myTurret ;;Pointer to my turret 13 | velocity ;;Velocity of the tank, non-negative 14 | health ;;Health of the tank. The tank dies when health < 0. 15 | startXcor ;;X coordinate when the tank is created 16 | startYcor ;;Y coordinate when the tank is created 17 | wins ;;Number of wins 18 | 19 | ;;Users can set the values of these variables in the code------------------ 20 | degree ;;Degree to rotate the tank 21 | acceleration ;;Indicator of acceleration: -1 for decelerate, 1 for accelerate, 0 for none 22 | 23 | ] 24 | 25 | blueTanks-own [ 26 | ;;Users should not set the values of these variables in the code---------- 27 | name ;;Name of the tank 28 | myTurret ;;Pointer to my turret 29 | velocity ;;Velocity of the tank, non-negative 30 | health ;;Health of the tank. The tank dies when health < 0. 31 | startXcor ;;X coordinate when the tank is created 32 | startYcor ;;Y coordinate when the tank is created 33 | wins ;;Number of wins 34 | 35 | ;;Users can set the values of these variables in the code------------------ 36 | degree ;;Degree to rotate the tank 37 | acceleration ;;Indicator of acceleration: -1 for decelerate, 1 for accelerate, 0 for none 38 | 39 | ;;Users can define their own variables here-------------------------------- 40 | ] 41 | 42 | turrets-own [ 43 | ;;Users should not set the values of these variables in the code--------- 44 | heat ;;Heat of the turret 45 | fp ;;Firepower 46 | 47 | ;;Users can set the values of these variables in the code----------------- 48 | degree ;;Degree to rotate the turret 49 | fire? ;;Control turret fire: true for fire, false for no fire 50 | ] 51 | 52 | bullets-own [ 53 | ;;Users should not set the values of these variables in the code--------- 54 | velocity 55 | damage 56 | ] 57 | 58 | globals [ 59 | ;;Users should not set the values of these variables in the code--------- 60 | TankSize 61 | StartHealth 62 | CollisionHealth ;;Health damage from collisions with tanks or walls 63 | MaxTurretRotation 64 | VTankAcc ;;Acceleration of tank 65 | VTankDec ;;Deceleration of tank 66 | VTankMax ;;Max speed of tank 67 | VFactor ;;For speed adjustment 68 | FireHeat ;;Heat generated at each fire 69 | TankRed 70 | TankBlue 71 | Tanks 72 | ] 73 | 74 | to setup 75 | ca 76 | set VFactor 0.02 77 | set FireHeat 20 78 | set TankSize 3 79 | set StartHealth 100 80 | set CollisionHealth -5 81 | set MaxTurretRotation 20 * VFactor 82 | set VTankMax 1 * VFactor 83 | set VTankAcc 0.2 * VFactor 84 | set VTankDec -0.4 * VFactor 85 | set Tanks nobody 86 | ask patches with [pxcor = min-pxcor or pxcor = max-pxcor or pycor = min-pycor or pycor = max-pycor][ 87 | set pcolor yellow 88 | ] 89 | reset-ticks 90 | end 91 | 92 | to obs-create-tank [argColor argPos] 93 | let tr nobody 94 | 95 | if Tanks != nobody and count Tanks with [color = argColor] > 0 [ 96 | ask Tanks with [color = argColor] [ 97 | ask myTurret [die] 98 | die 99 | ] 100 | ] 101 | create-turtles 1 [ 102 | if argColor = red [ 103 | set breed redTanks 104 | set TankRed self 105 | ] 106 | if argColor = blue [ 107 | set breed blueTanks 108 | set TankBlue self 109 | ] 110 | if argPos = 1 [setxy max-pxcor - tankSize max-pycor - tankSize] 111 | if argPos = 5 [setxy min-pxcor + tankSize min-pycor + tankSize] 112 | set shape "tank" 113 | set name TankName 114 | set color argColor 115 | set size TankSize 116 | set health StartHealth 117 | hatch 1 [ 118 | set breed turrets 119 | set shape "turret" 120 | set fp FirePower 121 | set tr self 122 | ] 123 | set myTurret tr 124 | create-link-to tr [ 125 | tie 126 | set hidden? true 127 | ] 128 | facexy 0 0 129 | set startXcor xcor 130 | set startYcor ycor 131 | set Tanks (turtle-set Tanks self) 132 | set-current-plot "Health" 133 | create-temporary-plot-pen name 134 | ] 135 | end 136 | 137 | to obs-reset 138 | ask bullets [die] 139 | ask Tanks [ 140 | set xcor StartXcor 141 | set ycor StartYcor 142 | set health StartHealth 143 | facexy 0 0 144 | ] 145 | ask turrets [ 146 | set heat 0 147 | ] 148 | obs-reset-plots 149 | cd 150 | reset-ticks 151 | end 152 | 153 | to obs-go 154 | let tks Tanks with [health > 0] 155 | 156 | ifelse LeaveTrack? [ask tks [pd]] [ask tks [pu]] 157 | ask tks [ 158 | tank-prepare 159 | ] 160 | ask tks [ 161 | ask myTurret [ 162 | turret-rotate 163 | turret-fire 164 | turret-cooldown 165 | ] 166 | ] 167 | ask bullets [ 168 | bullet-forward 169 | bullet-check-collision 170 | ] 171 | ask tks [ 172 | tank-rotate 173 | tank-change-velocity 174 | tank-forward 175 | tank-check-collision 176 | ] 177 | obs-update-plots 178 | if obs-check-win [stop] 179 | tick 180 | end 181 | 182 | to-report obs-check-win 183 | let tks Tanks with [health > 0] 184 | if count tks = 1 [ 185 | ask one-of tks [set wins wins + 1] 186 | user-message (word "Winner: " [name] of one-of tks) 187 | report true 188 | ] 189 | if count tks = 0 [ 190 | user-message "Tie" 191 | report true 192 | ] 193 | report false 194 | end 195 | 196 | to obs-update-plots 197 | set-current-plot "Health" 198 | ask Tanks [ 199 | set-current-plot-pen name 200 | set-plot-pen-color color 201 | plot health 202 | ] 203 | end 204 | 205 | to obs-reset-plots 206 | set-current-plot "Health" 207 | ask Tanks [ 208 | set-current-plot-pen name 209 | plot-pen-reset 210 | ] 211 | end 212 | 213 | to tank-accelerate 214 | set velocity min list VTankMax (velocity + VTankAcc) 215 | end 216 | 217 | to tank-decelerate 218 | set velocity max list 0 (velocity + VTankDec) 219 | end 220 | 221 | to tank-change-velocity 222 | if acceleration = -1 [tank-decelerate] 223 | if acceleration = 1 [tank-accelerate] 224 | end 225 | 226 | to tank-forward 227 | fd velocity 228 | end 229 | 230 | to tank-rotate 231 | if degree = 0 [stop] 232 | let dMax 10 - 5 * velocity / VTankMax 233 | let th [heading] of myTurret 234 | set heading heading + degree / (abs degree) * (max list dMax abs degree) 235 | ask myTurret [set heading th] 236 | end 237 | 238 | to tank-check-collision 239 | let tks other Tanks with [distance myself <= TankSize] 240 | if count tks > 0 [ 241 | ask tks [ 242 | set health health + CollisionHealth 243 | fd 0 - TankSize / 2 244 | set velocity 0 245 | ] 246 | set health health + CollisionHealth 247 | fd 0 - TankSize / 2 248 | set velocity 0 249 | ] 250 | if pcolor = yellow [ 251 | set health health - velocity * 10 252 | set velocity 0 253 | move-to one-of neighbors with [pcolor != yellow] 254 | ] 255 | end 256 | 257 | to tank-prepare 258 | if color = red [tank-prepare-red] 259 | if color = blue [tank-prepare-blue] 260 | end 261 | 262 | to turret-rotate 263 | if degree = 0 [stop] 264 | set heading heading + degree / (abs degree) * (max list MaxTurretRotation abs degree) 265 | end 266 | 267 | to turret-fire 268 | if not fire? or heat > 0 [stop] 269 | let tfp fp 270 | hatch 1 [ 271 | set breed bullets 272 | set color white 273 | set shape "circle" 274 | set size 0.2 * tfp 275 | fd tankSize / 2 276 | set velocity (3 - 0.3 * tfp) * VFactor 277 | set damage tfp * 4 * (3 - 0.3 * 5) * VFactor / velocity 278 | ] 279 | set heat heat + fp * FireHeat 280 | end 281 | 282 | to turret-cooldown 283 | set heat max list 0 (heat - 1) 284 | end 285 | 286 | to bullet-forward 287 | fd velocity 288 | end 289 | 290 | to bullet-check-collision 291 | let tks tanks with [distance myself < (TankSize / 2)] 292 | if count tks > 0 [ 293 | ask tks [ 294 | set health health - [damage] of myself 295 | ] 296 | die 297 | ] 298 | if pcolor = yellow [die] 299 | end 300 | 301 | ;; ================================================================================================ 302 | ;; =================================== Don't make changes above =================================== 303 | ;; ================================================================================================ 304 | 305 | ;; ================================================================================================ 306 | ;; = The following code drives the 'best' red tank, 307 | ;; = all you need is to make your blue tank better than it! 308 | ;; = 309 | ;; = You can not make change related to the red tank here. 310 | ;; ================================================================================================= 311 | 312 | ;; ======== status-1 【move forward status】========= 313 | to status-forward[v] 314 | if((item 0 v) != nobody)[ 315 | set velocity (item 0 v) 316 | ] 317 | set degree 0 318 | fd velocity 319 | end 320 | 321 | to status-random-forward[tickNum] 322 | if ((item 0 tickNum) != nobody)[ 323 | if (ticks mod (item 0 tickNum) = 0)[set heading random-float 360] 324 | ] 325 | end 326 | 327 | ;; ======== status-2 【move back status】========= 328 | to status-back 329 | set heading degree + 180 330 | bk velocity 331 | end 332 | 333 | ;; ======== status-3 【turn left status】========= 334 | to status-left 335 | set heading degree + 90 336 | lt velocity 337 | end 338 | 339 | ;; ======== status-4 【turn right status】========= 340 | to status-right 341 | set heading degree - 90 342 | rt velocity 343 | end 344 | 345 | ;; ======== status-5 【stop status】========= 346 | to status-stop 347 | set degree 0 348 | set acceleration 0 349 | set velocity 0 350 | fd 0 351 | end 352 | 353 | ;; ======== status-6 【find direction status】========= 354 | ;; find a safe direction before hitting on the wall or other tanks. 355 | to status-stop-turn-wall 356 | let tempDirection (random-float 360) 357 | if((patch-at-heading-and-distance tempDirection 1) != nobody)[ 358 | ask patch-at-heading-and-distance tempDirection 1 [ 359 | if (pcolor != yellow)[ 360 | ask myself[ 361 | set heading tempDirection 362 | fd velocity 363 | ] 364 | ] 365 | ] 366 | ] 367 | end 368 | 369 | to status-stop-turn-tank 370 | let tks other Tanks with [distance myself > TankSize] 371 | if(patch-at-heading-and-distance heading 2 != nobody)[ 372 | ask patch-at-heading-and-distance heading 2 [ 373 | if (pcolor = black)[ 374 | ask myself[ 375 | status-random-lrb 376 | if item 0 [velocity] of tks != nobody [ 377 | fd (item 0 [velocity] of tks) 378 | ] 379 | ] 380 | ] 381 | ] 382 | ] 383 | end 384 | 385 | ;; ======== status-7 【random turn left/right status】========= 386 | to status-random-lrb 387 | let direction random 180 388 | if (direction > 0 and direction < 60)[status-left] 389 | if (direction > 60 and direction < 120)[status-right] 390 | if (direction > 120)[status-back] 391 | end 392 | 393 | ;; ======== status-8 【dodge other's attack status】======== 394 | to status-dodge-forward[args] 395 | let tks other Tanks with [distance myself > TankSize] 396 | if count tks > 0[ 397 | ifelse ticks < 100 [ 398 | status-random-forward[101] 399 | ][ 400 | ifelse(ticks mod (item 0 args) = 0)[ 401 | let tempNum random 100 402 | ifelse (tempNum mod 2 = 0)[ 403 | set heading ([heading] of (item 0 [myTurret] of tks) + 90) 404 | ][ 405 | set heading ([heading] of (item 0 [myTurret] of tks) - 90) 406 | ] 407 | ][status-forward[0.01]] 408 | ] 409 | ] 410 | end 411 | 412 | ;; ======== 【set the moving status per tick】========= 413 | ;; this function will be called every ticks, we should set up the status machine here. 414 | to tank-prepare-red 415 | let tks other Tanks with [distance myself < TankSize + 3] 416 | ifelse count tks > 0 [status-stop-turn-tank][status-forward[0.01]] 417 | status-dodge-forward[500] 418 | 419 | ask patches with [distance myself < 2 and pcolor = yellow][ 420 | ask myself[ 421 | status-stop-turn-wall 422 | ] 423 | ] 424 | 425 | ask myTurret [ 426 | let enemys other Tanks with [distance myself > TankSize] ;with [distance myself < TankSize + 10]; 427 | if(count enemys > 0)[ 428 | if (item 0 ([patch-ahead 5] of enemys) != nobody)[ 429 | facexy ([pxcor] of item 0 ([patch-ahead 5] of enemys)) ([pycor] of item 0 ([patch-ahead 5] of enemys)) 430 | ] 431 | ] 432 | set fire? true 433 | ] 434 | end 435 | 436 | ;; ================================================================================================ 437 | ;; =================================== Don't make changes above =================================== 438 | ;; ================================================================================================ 439 | 440 | 441 | 442 | ;; =========================================================================================================================== 443 | ;; =================================== The following procedures can be defined by the use ==================================== 444 | ;; =========================================================================================================================== 445 | 446 | ;; You can build your tank here! and free to write new functions! 447 | ;; If you can beat the red tank (test over 100 times, if you win over 70% of the games, please send us a PR) 448 | ;; We will update the 'abest tank' as you designed, and your github avatar is and id will display in our github page. 449 | 450 | ;; =========================================================================================================================== 451 | 452 | to tank-prepare-blue 453 | let tks other Tanks with [distance myself < TankSize + 3] 454 | ifelse count tks > 0 [status-stop-turn-tank][status-forward[0.01]] 455 | status-random-forward[700] 456 | 457 | ask patches with [distance myself < 2 and pcolor = yellow][ 458 | ask myself[ 459 | status-stop-turn-wall 460 | ] 461 | ] 462 | 463 | ask myTurret [ 464 | let enemys other Tanks with [distance myself > TankSize] ;with [distance myself < TankSize + 10] ;等到敌人进入距离自己 10(假)再攻击他们 465 | if(count enemys > 0)[ 466 | if (item 0 ([patch-ahead 5] of enemys) != nobody)[ 467 | facexy ([pxcor] of item 0 ([patch-ahead 5] of enemys)) ([pycor] of item 0 ([patch-ahead 5] of enemys)) 468 | ] 469 | ] 470 | set fire? true 471 | ] 472 | end 473 | @#$#@#$#@ 474 | GRAPHICS-WINDOW 475 | 310 476 | 24 477 | 747 478 | 462 479 | -1 480 | -1 481 | 13.0 482 | 1 483 | 10 484 | 1 485 | 1 486 | 1 487 | 0 488 | 0 489 | 0 490 | 1 491 | -16 492 | 16 493 | -16 494 | 16 495 | 1 496 | 1 497 | 1 498 | ticks 499 | 30.0 500 | 501 | BUTTON 502 | 763 503 | 271 504 | 864 505 | 304 506 | NIL 507 | setup 508 | NIL 509 | 1 510 | T 511 | OBSERVER 512 | NIL 513 | NIL 514 | NIL 515 | NIL 516 | 1 517 | 518 | INPUTBOX 519 | 1100 520 | 400 521 | 1273 522 | 461 523 | TankName 524 | blue tank 525 | 1 526 | 0 527 | String 528 | 529 | BUTTON 530 | 824 531 | 26 532 | 960 533 | 71 534 | Create Red Tank 535 | obs-create-tank red 1 536 | NIL 537 | 1 538 | T 539 | OBSERVER 540 | NIL 541 | NIL 542 | NIL 543 | NIL 544 | 1 545 | 546 | BUTTON 547 | 95 548 | 419 549 | 237 550 | 461 551 | Create Blue Tank 552 | obs-create-tank blue 5 553 | NIL 554 | 1 555 | T 556 | OBSERVER 557 | NIL 558 | NIL 559 | NIL 560 | NIL 561 | 1 562 | 563 | SLIDER 564 | 1099 565 | 314 566 | 1272 567 | 347 568 | FirePower 569 | FirePower 570 | 1 571 | 5 572 | 2.0 573 | 1 574 | 1 575 | NIL 576 | HORIZONTAL 577 | 578 | BUTTON 579 | 985 580 | 269 581 | 1088 582 | 303 583 | go 584 | obs-go 585 | T 586 | 1 587 | T 588 | OBSERVER 589 | NIL 590 | NIL 591 | NIL 592 | NIL 593 | 1 594 | 595 | BUTTON 596 | 873 597 | 270 598 | 978 599 | 304 600 | reset 601 | obs-reset 602 | NIL 603 | 1 604 | T 605 | OBSERVER 606 | NIL 607 | NIL 608 | NIL 609 | NIL 610 | 1 611 | 612 | MONITOR 613 | 245 614 | 416 615 | 303 616 | 461 617 | Win 618 | [wins] of TankBlue 619 | 17 620 | 1 621 | 11 622 | 623 | MONITOR 624 | 758 625 | 26 626 | 816 627 | 71 628 | Win 629 | [wins] of TankRed 630 | 17 631 | 1 632 | 11 633 | 634 | PLOT 635 | 759 636 | 313 637 | 1091 638 | 463 639 | Health 640 | NIL 641 | NIL 642 | 0.0 643 | 10.0 644 | 0.0 645 | 10.0 646 | true 647 | true 648 | "" "" 649 | PENS 650 | 651 | SWITCH 652 | 1100 653 | 358 654 | 1271 655 | 391 656 | LeaveTrack? 657 | LeaveTrack? 658 | 0 659 | 1 660 | -1000 661 | 662 | @#$#@#$#@ 663 | ## WHAT IS IT? 664 | 665 | TankLogo aims for training the users' basic NetLogo programming techniques. It simulates a battle field with multiple tanks combating each other. 666 | 667 | ## HOW IT WORKS 668 | 669 | The model pre-defines the basic behavior of the agents. The users have to define the specific behavior of their own tanks so that the tanks can think and behave automatically without human intervensions. The goal, of course, is to WIN! 670 | 671 | ## HOW TO USE IT 672 | 673 | The users define the procedures like "tank-prepare-red, tank-prepare-blue" which prepare the parameters determining the tanks' behavior in each turn (tick). 674 | 675 | ## THINGS TO NOTICE 676 | 677 | The users should not change the codes about the agents' basic behavior. 678 | 679 | Collosions between the tanks or tanks and walls inflict damage. 680 | 681 | ## THINGS TO TRY 682 | 683 | "FirePower" slide sets the fire power of a tank's gun. More fire power means a bullet can inflict more damage but with less velocity. Moreover, a more powful gun needs more time to cool down. When a gun is hot, it cannot fire. 684 | 685 | ## EXTENDING THE MODEL 686 | 687 | (suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.) 688 | 689 | ## NETLOGO FEATURES 690 | 691 | (interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features) 692 | 693 | ## RELATED MODELS 694 | 695 | TankLogo is inspired by Robocode (https://robocode.sourceforge.io/) 696 | 697 | ## CREDITS AND REFERENCES 698 | 699 | TankLogo is developed by Wei Zhu, Department of Urban Planning, Tongji University, Shanghai, China 700 | Version-20180925 701 | @#$#@#$#@ 702 | default 703 | true 704 | 0 705 | Polygon -7500403 true true 150 5 40 250 150 205 260 250 706 | 707 | airplane 708 | true 709 | 0 710 | Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15 711 | 712 | arrow 713 | true 714 | 0 715 | Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 716 | 717 | box 718 | false 719 | 0 720 | Polygon -7500403 true true 150 285 285 225 285 75 150 135 721 | Polygon -7500403 true true 150 135 15 75 150 15 285 75 722 | Polygon -7500403 true true 15 75 15 225 150 285 150 135 723 | Line -16777216 false 150 285 150 135 724 | Line -16777216 false 150 135 15 75 725 | Line -16777216 false 150 135 285 75 726 | 727 | bug 728 | true 729 | 0 730 | Circle -7500403 true true 96 182 108 731 | Circle -7500403 true true 110 127 80 732 | Circle -7500403 true true 110 75 80 733 | Line -7500403 true 150 100 80 30 734 | Line -7500403 true 150 100 220 30 735 | 736 | butterfly 737 | true 738 | 0 739 | Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240 740 | Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240 741 | Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163 742 | Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165 743 | Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225 744 | Circle -16777216 true false 135 90 30 745 | Line -16777216 false 150 105 195 60 746 | Line -16777216 false 150 105 105 60 747 | 748 | car 749 | false 750 | 0 751 | Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180 752 | Circle -16777216 true false 180 180 90 753 | Circle -16777216 true false 30 180 90 754 | Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89 755 | Circle -7500403 true true 47 195 58 756 | Circle -7500403 true true 195 195 58 757 | 758 | circle 759 | false 760 | 0 761 | Circle -7500403 true true 0 0 300 762 | 763 | circle 2 764 | false 765 | 0 766 | Circle -7500403 true true 0 0 300 767 | Circle -16777216 true false 30 30 240 768 | 769 | cow 770 | false 771 | 0 772 | Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167 773 | Polygon -7500403 true true 73 210 86 251 62 249 48 208 774 | Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123 775 | 776 | cylinder 777 | false 778 | 0 779 | Circle -7500403 true true 0 0 300 780 | 781 | dot 782 | false 783 | 0 784 | Circle -7500403 true true 90 90 120 785 | 786 | face happy 787 | false 788 | 0 789 | Circle -7500403 true true 8 8 285 790 | Circle -16777216 true false 60 75 60 791 | Circle -16777216 true false 180 75 60 792 | Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240 793 | 794 | face neutral 795 | false 796 | 0 797 | Circle -7500403 true true 8 7 285 798 | Circle -16777216 true false 60 75 60 799 | Circle -16777216 true false 180 75 60 800 | Rectangle -16777216 true false 60 195 240 225 801 | 802 | face sad 803 | false 804 | 0 805 | Circle -7500403 true true 8 8 285 806 | Circle -16777216 true false 60 75 60 807 | Circle -16777216 true false 180 75 60 808 | Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183 809 | 810 | fish 811 | false 812 | 0 813 | Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166 814 | Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165 815 | Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60 816 | Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166 817 | Circle -16777216 true false 215 106 30 818 | 819 | flag 820 | false 821 | 0 822 | Rectangle -7500403 true true 60 15 75 300 823 | Polygon -7500403 true true 90 150 270 90 90 30 824 | Line -7500403 true 75 135 90 135 825 | Line -7500403 true 75 45 90 45 826 | 827 | flower 828 | false 829 | 0 830 | Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135 831 | Circle -7500403 true true 85 132 38 832 | Circle -7500403 true true 130 147 38 833 | Circle -7500403 true true 192 85 38 834 | Circle -7500403 true true 85 40 38 835 | Circle -7500403 true true 177 40 38 836 | Circle -7500403 true true 177 132 38 837 | Circle -7500403 true true 70 85 38 838 | Circle -7500403 true true 130 25 38 839 | Circle -7500403 true true 96 51 108 840 | Circle -16777216 true false 113 68 74 841 | Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218 842 | Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240 843 | 844 | house 845 | false 846 | 0 847 | Rectangle -7500403 true true 45 120 255 285 848 | Rectangle -16777216 true false 120 210 180 285 849 | Polygon -7500403 true true 15 120 150 15 285 120 850 | Line -16777216 false 30 120 270 120 851 | 852 | leaf 853 | false 854 | 0 855 | Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195 856 | Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195 857 | 858 | line 859 | true 860 | 0 861 | Line -7500403 true 150 0 150 300 862 | 863 | line half 864 | true 865 | 0 866 | Line -7500403 true 150 0 150 150 867 | 868 | pentagon 869 | false 870 | 0 871 | Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120 872 | 873 | person 874 | false 875 | 0 876 | Circle -7500403 true true 110 5 80 877 | Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90 878 | Rectangle -7500403 true true 127 79 172 94 879 | Polygon -7500403 true true 195 90 240 150 225 180 165 105 880 | Polygon -7500403 true true 105 90 60 150 75 180 135 105 881 | 882 | plant 883 | false 884 | 0 885 | Rectangle -7500403 true true 135 90 165 300 886 | Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285 887 | Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285 888 | Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210 889 | Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135 890 | Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135 891 | Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60 892 | Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90 893 | 894 | sheep 895 | false 896 | 15 897 | Circle -1 true true 203 65 88 898 | Circle -1 true true 70 65 162 899 | Circle -1 true true 150 105 120 900 | Polygon -7500403 true false 218 120 240 165 255 165 278 120 901 | Circle -7500403 true false 214 72 67 902 | Rectangle -1 true true 164 223 179 298 903 | Polygon -1 true true 45 285 30 285 30 240 15 195 45 210 904 | Circle -1 true true 3 83 150 905 | Rectangle -1 true true 65 221 80 296 906 | Polygon -1 true true 195 285 210 285 210 240 240 210 195 210 907 | Polygon -7500403 true false 276 85 285 105 302 99 294 83 908 | Polygon -7500403 true false 219 85 210 105 193 99 201 83 909 | 910 | square 911 | false 912 | 0 913 | Rectangle -7500403 true true 30 30 270 270 914 | 915 | square 2 916 | false 917 | 0 918 | Rectangle -7500403 true true 30 30 270 270 919 | Rectangle -16777216 true false 60 60 240 240 920 | 921 | star 922 | false 923 | 0 924 | Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108 925 | 926 | tank 927 | true 928 | 0 929 | Rectangle -7500403 true true 45 90 255 255 930 | Polygon -7500403 true true 150 30 45 75 255 75 931 | 932 | target 933 | false 934 | 0 935 | Circle -7500403 true true 0 0 300 936 | Circle -16777216 true false 30 30 240 937 | Circle -7500403 true true 60 60 180 938 | Circle -16777216 true false 90 90 120 939 | Circle -7500403 true true 120 120 60 940 | 941 | tree 942 | false 943 | 0 944 | Circle -7500403 true true 118 3 94 945 | Rectangle -6459832 true false 120 195 180 300 946 | Circle -7500403 true true 65 21 108 947 | Circle -7500403 true true 116 41 127 948 | Circle -7500403 true true 45 90 120 949 | Circle -7500403 true true 104 74 152 950 | 951 | triangle 952 | false 953 | 0 954 | Polygon -7500403 true true 150 30 15 255 285 255 955 | 956 | triangle 2 957 | false 958 | 0 959 | Polygon -7500403 true true 150 30 15 255 285 255 960 | Polygon -16777216 true false 151 99 225 223 75 224 961 | 962 | truck 963 | false 964 | 0 965 | Rectangle -7500403 true true 4 45 195 187 966 | Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194 967 | Rectangle -1 true false 195 60 195 105 968 | Polygon -16777216 true false 238 112 252 141 219 141 218 112 969 | Circle -16777216 true false 234 174 42 970 | Rectangle -7500403 true true 181 185 214 194 971 | Circle -16777216 true false 144 174 42 972 | Circle -16777216 true false 24 174 42 973 | Circle -7500403 false true 24 174 42 974 | Circle -7500403 false true 144 174 42 975 | Circle -7500403 false true 234 174 42 976 | 977 | turret 978 | true 979 | 0 980 | Rectangle -16777216 true false 120 45 180 120 981 | Circle -16777216 true false 96 96 108 982 | Circle -1 true false 108 108 85 983 | Rectangle -1 true false 135 60 165 120 984 | 985 | turtle 986 | true 987 | 0 988 | Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210 989 | Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105 990 | Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105 991 | Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87 992 | Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210 993 | Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99 994 | 995 | wheel 996 | false 997 | 0 998 | Circle -7500403 true true 3 3 294 999 | Circle -16777216 true false 30 30 240 1000 | Line -7500403 true 150 285 150 15 1001 | Line -7500403 true 15 150 285 150 1002 | Circle -7500403 true true 120 120 60 1003 | Line -7500403 true 216 40 79 269 1004 | Line -7500403 true 40 84 269 221 1005 | Line -7500403 true 40 216 269 79 1006 | Line -7500403 true 84 40 221 269 1007 | 1008 | wolf 1009 | false 1010 | 0 1011 | Polygon -16777216 true false 253 133 245 131 245 133 1012 | Polygon -7500403 true true 2 194 13 197 30 191 38 193 38 205 20 226 20 257 27 265 38 266 40 260 31 253 31 230 60 206 68 198 75 209 66 228 65 243 82 261 84 268 100 267 103 261 77 239 79 231 100 207 98 196 119 201 143 202 160 195 166 210 172 213 173 238 167 251 160 248 154 265 169 264 178 247 186 240 198 260 200 271 217 271 219 262 207 258 195 230 192 198 210 184 227 164 242 144 259 145 284 151 277 141 293 140 299 134 297 127 273 119 270 105 1013 | Polygon -7500403 true true -1 195 14 180 36 166 40 153 53 140 82 131 134 133 159 126 188 115 227 108 236 102 238 98 268 86 269 92 281 87 269 103 269 113 1014 | 1015 | x 1016 | false 1017 | 0 1018 | Polygon -7500403 true true 270 75 225 30 30 225 75 270 1019 | Polygon -7500403 true true 30 75 75 30 270 225 225 270 1020 | @#$#@#$#@ 1021 | NetLogo 6.0.4 1022 | @#$#@#$#@ 1023 | @#$#@#$#@ 1024 | @#$#@#$#@ 1025 | @#$#@#$#@ 1026 | @#$#@#$#@ 1027 | default 1028 | 0.0 1029 | -0.2 0 0.0 1.0 1030 | 0.0 1 1.0 0.0 1031 | 0.2 0 0.0 1.0 1032 | link direction 1033 | true 1034 | 0 1035 | Line -7500403 true 150 150 90 180 1036 | Line -7500403 true 150 150 210 180 1037 | @#$#@#$#@ 1038 | 0 1039 | @#$#@#$#@ 1040 | --------------------------------------------------------------------------------