Netlogo 的教程,一直都很稀缺。. 那些真正的专家,往往会过度低估 Netlogo 的入门和上手难度,只是希望把它作为工具,介绍复杂系统研究。. 例如 Melanie Mitchell 的课程 ,便是如此。. 在这些课程里,Netlogo 会被广泛用到,但是其功能使用的细节,不作为重点. An essential step to speeding up a model is measuring execution speed so that particularly slow parts can be identified and so that attempts to speed up execution can be evaluated quantitatively. NetLogo provides two tools for doing so. The first tool is the timer, used via the primitives reset-timer and timer.
There are 64 single men and 64 single women, all heterosexual its is presumed, who want to get married. Each one ranks all possible mates. The problem is how to find the set of marriages so that no two people (one man one woman) that are not married to each other do, in fact, prefer each other over their assigned partners.
Netlogon Service
The solution we implement is the deferred acceptance algorithm from
- D. Gale and L. S. Shapley. College Admissions and the Stability of Marriage. The American Mathematical Monthly, 69(1):9--15, Mathematical Association of America. 1962.
Netlogo Download
In this model the woman are the pink circles and the men are blue (well, cyan). When a man connects to a woman (edge) it means he proposes to her. The numbers in the nodes represent the preference of that node for its partner. The algorithm works as follows
- while there are women without a proposal
- every man proposes to the his most preferred woman who has not rejected him
- every woman with multiple proposals rejects all but the one she prefers the most
When done, all women have one proposal which they accept and live happily ever after. The resulting marriages are stable.
Netlogo
The scatter plot shows the marriages that we find, where the x coordinate is the man's preference for the woman and the y coordinate is the woman's preference for the man (1 means her most preferred). Notice that even though women turn down men, the men do much better.