

Finally, you can include the output at the end of your simulation (note how I changed go compared to the previous code example):įile-print (word who "," mypathx "," mypathy "," mytimer).Now, mypathx, mypathy and mytimer are legal inputs to the lput procedure. This includes the case in which you want to create an empty list. If you want to create a list containing any other amount of values, you have to use (list. But if you just remove the die command, or if you ask turtles to output before they die, you would get an error - saying that lput expected a list but got something else instead.įrom the NetLogo Dictionary you can see that the list primitive is used to create a list with two values. If you run your piece of code now, nothing happens because all turtles are dead by the time you ask them to output. You are not initiating the turtles-own variables as lists. Set mytimer lput ticks mytimer This is what I assumed you want mytimer to do. To combine this point and the previous one, I would do something like: It would be ideal to include a piece of code where you ask turtles, after each move, to record their location in the list. when output is called) they are are asked to save their current location. However, there is also something that Filip rightly noticed in the comment to the question: it seems logical to ask turtles to save the coordinates of their journey as they move - as opposed to asking them to do so at the end of the simulation.īased on the current code, turtles simply move in the simulation, and only at the end (e.g. Therefore, it is normal that there is no data to be exported: in output you ask turtles, but when output is executed all turtles already left the simulation. There are a number of things to note here, so I hope I understood what you inteded to do.įirst of all, note that your code goes to output only after all the turtles died (that is infact one of the conditions to go to output: if n = 0). If n = 0 and output? = true ouput? is an switch on interfaceįile-print (word item i mypathx " " item i mypathy " " item i mytimer) That is, when inspecting the turtle I don't see the list and when creating the file in. And finally, generate the file of this information in.
Netlogo lput Patch#
The problem is that I cannot create an empty list for each turtle created and then, before every move, add the current patch location to the lists. I'm thinking about creating a list that gives me this information and then saving it. In this way, I would like to extract the coordinates of the path taken by all the turtles in the world. For example, I would like to know the path taken by turtle 0 was patch 00 patch 0 5 patch 0 2 and patch 1 4 and save this information in a. Ahora se elige el mayor calce con el menor desbalance.I'm still trying to extract the coordinates of the path taken by every turtle in the world. 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
