1 / 13
文档名称:

logo.docx

格式:docx   大小:18KB   页数:13页
下载后只包含 1 个 DOCX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

logo.docx

上传人:beny00001 2019/8/22 文件大小:18 KB

下载得到文件列表

logo.docx

相关文档

文档介绍

文档介绍:《系统工程》课程实验报告班级:学号:姓名:1)logo编程语言的特点和基本语法。2)logo基本Model的语句解析和仿真流程分析。学号尾数为1、puterScience目录下的Pagerank2、7号:Biology目录下的Heatbugs3、8号:Biology目录下的Virus4、9号:SocialScience目录下SugarScape中的Voting5、0号:Biology目录下的Ants实验过程与结果:1)语句解析:turtles-own[ideal-temp;;ThetemperatureIwanttobeatoutput-heat;;HowmuchheatIemitpertimestepunhappiness;;Themagnitudeofthedifferencebetweenmyideal;;temperatureandtheactualcurrenttemperaturehere]基础变量[理想温度;;我想要的温度输出热量;;我每次排放的热量是多少不快乐;;我的理想之间的大小差异;,温度和当前的实际温度]patches-own[temp;;shortfor"temperature"]自己的修补程序临时;,简称“温度”tosetupclear-allsetcolor-by-unhappiness?false;;creatingthebugsthefollowingwayensuresthatwewon't;;windupwithmorethanonebugonapatchaskn-ofbug-countpatches[sprout1[setideal-tempmin-ideal-temp+random(max-ideal-temp-min-ideal-temp)setoutput-heatmin-output-heat+random(max-output-heat-min-output-heat)setunhappinessabs(ideal-temp-temp)color-by-ideal-tempfaceone-ofneighborssetsize2;;easiertosee]];;plottheinitialstateofthesystemreset-ticksendtocolor-by-ideal-temp;;whenscalingthecolorofturtles,adjustthevalue;;-adjustment(max-ideal-temp-min-ideal-temp)/2setcolorscale-colorlimeideal-temp(min-ideal-temp-range-adjustment)(max-ideal-temp+range-adjustment)endtocolor-by-unhappiness[max-unhappiness]setcolorscale-colorblueunhappinessmax-unhappiness0endtogoifnotany?turtles[stop];;diffuseheatthroughworlddiffusetempdiffusion-rate;;Theworldretainsapercentageofitsheateachcycle.;;(;;;;;wereversethescaletobettermatchthename.)askpatches[settemptemp*(1-evaporation-rate)];;Logoarealwaysinrandomorder,so;;"askturtles"automaticallyshufflestheorderofexecution;;[step]recolor-turtlesrecolor-patchestickendtorecolor-turtlesifcolor-by-unhappiness?[letmax-unhappinessmax[unhappiness]ofturtlesaskturtles[color-by-unhappinessmax-unhappiness]]endtorecolor-patches;;hotterpatcheswillberedvergingonwhite;;;coolerpatcheswillbeblackaskpatches[setpc