Replies: 2 comments 2 replies
-
Dear,
Could you be more specific on the alternative you need ? what do you want
to do ?
one_of returns 1 random element, you also have among operator (n among
building) to return several building ...
Cheers
Benoit
Le jeu. 1 août 2024 à 17:37, OSPOKomIT ***@***.***> a écrit :
… Hello everyone,
I am currently trying to build my first model to simulate the movement of
schoolkids. I have data on students per city area and would like to
distribute my agents accordingly. I am building on the Road Traffic model
and am now looking for an alternative to
living_place <- *one_of*(residential_buildings)
Your help would be great
Best
Lukas
—
Reply to this email directly, view it on GitHub
<#277>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAL3WSVNFQJDEKUBEGNXMADZPJI33AVCNFSM6AAAAABL22MS52VHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZXGAYDGMRVHE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Hi,
n among residential_buildings would rather compute a list of N random
buildings.
If you want to create N students living in building
residential_buildingsXY, you can simply select the building first, and
locate all you N student agents in this building :
residential_buildings residential_buildingsXY <- compute the
residential building in which you have N students;
create students *number: N {*
speed <- rnd(min_speed_low, max_speed_low);
start_school <- rnd(min_school_start, max_school_start);
end_school <- rnd(min_school_end, max_school_end);*
living_place <- residential_buildingsXY ;*
school <- one_of(educational_buildings);
objective <- "study";
location <- any_location_in(living_place);
you can imagine having a data structure associating to each
residential_building the amount of students living in it, and loop over
this dictionary to create the number of agents associated to this building.
Cheers
Benoit
Le jeu. 26 sept. 2024 à 17:27, Lukas Cocinero ***@***.***> a
écrit :
… Hey,
thanks alot for your replay.
I specify:
I create some students:
create students number: nb_students{
speed <- rnd(min_speed_low, max_speed_low);
start_school <- rnd(min_school_start, max_school_start);
end_school <- rnd(min_school_end, max_school_end);
living_place <- one_of(residential_buildings);
school <- one_of(educational_buildings);
objective <- "study";
location <- any_location_in(living_place);
this will give a student agent a random living place of a random element
of residential_buildings, correct?
I want now to steer the number of students living in a certain
residential_buildings because I have a distribution of students living in
different areas. Such as: 60% of students living in area 1 --> distribute
my student agents in a similar manner. So I could say something like: n
students among residential_buildingsXY, correct ?
Best
Lukas
—
Reply to this email directly, view it on GitHub
<#277 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAL3WSSIAUQXNEI3U7J72TDZYQRXNAVCNFSM6AAAAABL22MS52VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTANZWGUZDEOI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I am currently trying to build my first model to simulate the movement of schoolkids. I have data on students per city area and would like to distribute my agents accordingly. I am building on the Road Traffic model and am now looking for an alternative to
living_place <- one_of(residential_buildings)
Your help would be great
Best
Lukas
Beta Was this translation helpful? Give feedback.
All reactions