Then, it should keep going until everyone are friends I think. My who = 6 and my friends are my who = 2 and my friends are my who = 7 and my friends are my who = 5 and my friends are my who = 0 and my friends are my who = 4 and my friends are my who = 8 and my friends are my who = 9 and my friends are my who = 3 and my friends are my who = 1 and my friends are My who = 4 and my friends are my who = 1 and my friends are my who = 9 and my friends are my who = 8 and my friends are my who = 7 and my friends are my who = 2 and my friends are my who = 3 and my friends are my who = 6 and my friends are my who = 5 and my friends are my who = 0 and my friends are Īnd then the next time you press the go button it should output this and so on I don't understand what to do for the go procedure though this is what the output should look like for each tick.įor instance, on the first tick the console should output this The setup procedure is not difficult, so I did The list must NOT contain duplicate numbers or the owner’s who number. If B is not yet in A’ list, use lput to add B’s who number. Use foreach to iterate through the list, and determine if B’s who number is already in the list. The Modeling Commons contains more than 2,000 other NetLogo models, contributed by modelers around the world. If a turtle A meets another turtle B it has not met before, then turtle A adds B’s “who” number to the end of A’s list. View, run, and discuss the 'Shortest path algorithm' model, written by Alvaro Gil. In each tick, every turtle randomly selects another turtle to interact (use one-of and other) Includes the “usual” commands (clear-all and resetticks in setup, tick in go, etc.)Įach turtle stores an initial empty list. My assignment is to do this.Ĭreates 10 turtles (any color) at the center (0,0) Ahora se elige el mayor calce con el menor desbalance.Hey, I figured there would be people on here with experience on NetLogo. Set tempar_prix_3 lput tempar_prix_2 tempar_prix_3 Set tempar_prix_2 replace-item 4 tempar_prix_2 (maxq - calce) Desbalance Set tempar_prix_2 replace-item 2 tempar_prix_2 length(filter ![]() Let filter_book_sell (filter book_buy)) Qc Aqui debemos comenzar con el algoritmo de calce de subastas 1) Ordenar todas las ofertas de compra y venta de mayor a menor If (pt+1 > min(book_temp) or senal bi and bi > 0) [ Si hay acciones a la venta a menor precio que su expectativa => COMPRA Set ri g1 * ln(global_fund / last(historic_price)) + g2 * rLi + ni * ei Set ei random-normal 0 1 Actualiza el error a cada instante If Distribucion_riqueza_inicial = "Lognormal"Įnd - GO SUBRUTINES - to update_expectations If Distribucion_riqueza_inicial = "Pareto" If Distribucion_riqueza_inicial = "Uniforme" If Distribucion_riqueza_inicial = "Normal" If Distribucion_riqueza_inicial = "Constante" Ifelse Media_riqueza_inicial > global_fund * 4 Set-plot-y-range (Fundamental - 1000) (Fundamental + 1000) Set historic_rent lput(ln(p1 / p0)) historic_rent] Set historic_price lput(p1) historic_price [set p1 aprox (p0 + p0 * randval) tick_size Set historic_price lput(p1) historic_price] ![]() Set historic_rent lput(randval) historic_rent Set randval random-normal (item 1 index_array) sqrt (item 4 index_array)] Set ei random-normal 0 1 Este valor se re-calcula a cada instante Set ni abs(random-normal 0 n0) chiarella lo usa solo y LeBaron con ABS Let tt length(portafolio) * last(historic_price) Set global_fund (lin_trend_fund * (1 + Magnitud / 50))Įnd - SETUP SUBRUTINES - to create_new_agents Set tempar lput(last(historic_price)) tempar Set book_sell Formato por posiciones 0 1 2 Valor Agente Titulo ![]() Set book_buy Formato por posiciones 0 1 2 3 Valor Agente Cantidad Vigente_Hasta Set historic_trans Formato por posiciones: 0 1 2 3 4 Periodo De Para Titulo Valor Set min_agentes int(Agentes_Iniciales / 2) Set array_ref Fund_perc, Tasa_ref if Crecimiento = true end to go move tick end to move ask turtles right random 360 forward 1 register-coordinates end to register-coordinates set mypathx lput pxcor mypathx.
0 Comments
Leave a Reply. |