![]() The cookie is used to store the user consent for the cookies in the category "Performance". This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. The cookies is used to store the user consent for the cookies in the category "Necessary". The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". The cookie is used to store the user consent for the cookies in the category "Analytics". ![]() These cookies ensure basic functionalities and security features of the website, anonymously. After you have tested it, then you have it die instead.Necessary cookies are absolutely essential for the website to function properly. That's so you can check the code is doing what you want. end1 is the source of a directed link and end2 is the target. The way it checks is to simply see if there is a link that has end2 to be its own end1 and also the other way. In turn, for the particular link, the code checks if there is a link in the opposite direction and sets that to the variable named opp-links. It randomly runs through all the links (think of it as a foreach except operating on a set of links rather than a list). So the interesting bit is the section that starts ask links. I think you already have that happening in your code. The first section has each turtle identify its out-link with the largest weight (or randomly selects one if two equally high) and then creates the link-set of all the other links and gets them to die. It then calls the kill-lowers procedure to do the link removal. The testme procedure just creates a complete network. So, I have instead started again and written a standalone model (put it in an empty NetLogo session) to do what I think you are trying to do. Lists seems like an awkward way to approach this and the way you are using any? is not going to work. I can't actually figure out how your code is supposed to work. I was hoping to compare each item of the two lists like so: if of max-end2 = any? of max-end1īut i have no idea how to combine the foreach command with the if command I have created the two lists with this: set max-end1 of max-one-of my-out-links ] of turtlesĪnd by setting an x and y parameter like so: ask turtles if this happens i want the link with the lower value to die. But, sometimes the max-out-link of two turtles are opposite of each other resulting in both links opposite of one another being selected. I've managed to select the max-out-link of every turtle. I have a complete directed graph with each link a weight of it's own. first remove any that's not a max weight Set max-end2 of max-one-of my-out-links ] of turtles 我创建了两个 列表: set max-end1 of max-one-of my-out-links ] of turtles
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |