Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tourism scenario #134

Open
jabrams23 opened this issue Sep 18, 2020 · 8 comments
Open

tourism scenario #134

jabrams23 opened this issue Sep 18, 2020 · 8 comments
Assignees

Comments

@jabrams23
Copy link
Contributor

i want to start working on a tourism scenario. so this would be mainly an interesting thing for devon at first, but then could also be used for international tourism potentially. what we need to do is: at timestep t sample X percent from our existing population and add that to population, assign those people to specific MSOAs where tourists would go and then pass this to the r code. pretty much all of this will be implemented on the python side. @nickmalleson should i give this a go?

@jabrams23
Copy link
Contributor Author

@nickmalleson so we need to add X number of people. I was thinking just randomly sampling from the population and duplicating them could be the easiest way to do that. The only thing we would have to change is the flows as people on vacation would not be going to school or work. what do you think?

@nickmalleson
Copy link
Collaborator

Sorry @jabrams23 for not replying sooner, this got buried under some less interesting admin.

Great idea to try the scenario, it should be reasoably straightforward. You will have to know how to add to pandas dataframes though so I'd recommend you do a quick tutorial on those. They're very similar to R dataframes, but the syntax varies slightly. I think just duplicating the people should be fine, you wont need to add anything to any other tables as far as I can think. The pointers to households, schools, etc. are just numbers that point to indices in other lists, so as long as a person line is duplicated in its entirety then all of those references will still work. The change may confuse some of the output file code and the dashboard as the number of individuals will have changed, but maybe not. That shouldn't be too difficult to manage anyway. I'd give it a try.

@jabrams23
Copy link
Contributor Author

@nickmalleson i am very experienced with python so its no problem for me to add to the pandas dataframe. only question is where in the code do you think it would be best to implement this?

@nickmalleson
Copy link
Collaborator

@jabrams23 probably somewhere in the step function

def step(self) -> None:

I guess either at the start or end? (i.e. before the risks and disease statuses get updated, or after). Let me know if you'd like me to add a parameter to allow the function to be turned on or off, a bit like the disable_disease_status parameter:

if not self.disable_disease_status:
(that one is only used for testing but I'd do something similar for the tourism function)

@jabrams23
Copy link
Contributor Author

ok. @nickmalleson i started thinking more about this. we cant just duplicate people because they each need their own flows...they wont go to work or school when on vacation. any ideas on best way to do this? i think we need to create a new function that adds the people at time step t and then assigns them a disease status and calculates their flows i.e.:

(pseudo code)
if timstep == tourism_timestep:
tourism_df = sample(pop_df, x)
tourism_df['status'] = new_status
tourism_df['workflow'] = 0
tourism_df['schoolflow'] = 0
new_df = append(pop_df, tourism_df)
return(new_df)

@nickmalleson
Copy link
Collaborator

Hi Jesse, my email may have clarified this further, but on the whole this looks fine. The only thing to add is that the flows and venues are lists as we don't know specifically which location someone goes to. So the pesudocode would be more like:

(pseudo code)
if timstep == tourism_timestep:
tourism_df = sample(pop_df, x)
tourism_df['status'] = new_status
tourism_df['workflow_locations'] = [0.85, 0.10, 0.05] # Flows to workplaces
tourism_df['workflow_flows'] = [98, 11, 13] # IDs of workplaces
...
new_df = append(pop_df, tourism_df)
return(new_df)

Also I've tried not to hardcode any strings. Have a look in column_names.py to see that standard naming conventions: (e.g. work would be something like "Work_Venues" and "Work_Flows"

https://github.com/Urban-Analytics/RAMP-UA/blob/master/microsim/column_names.py

@jabrams23
Copy link
Contributor Author

@github-actions
Copy link

Branch jabrams23-issue-134 created!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants