Open hanase opened 4 years ago
Hi @hanase! We could create an optional feature with warnings printed when the effect of relaxing the filtering conditions acts. Building on that, I imagine that a callback function could be passed when subset of agents to be sampled from is very small or even empty. Do you have something in mind you could describe about this?
Thanks @cvanoli! Yes - that would work. We usually relax the filtering if the number of agents to be sampled from is less than 1/3 of the target number. If a callback function is called when this kicks in that would work for us. Thanks!
Would it be possible to do anything about this issue? I see work on the transition model by @msoltadeo that may be related to a similar issue, but it doesn't seem to go in the direction that we need. A simple callback function that would allow us to implement the relaxing of the filtering condition would help a lot. Thank you.
The transition model will not work well if the subset of agents to be sampled from is very small or even empty. Thus, an option of relaxing the filtering conditions (as present in Opus) would be very useful (e.g. if there are not enough households of the given characteristics within the given city, sample from the corresponding county or the whole region).
If nothing else, an option to use a user-defined callback function would help, together with letting the model to access the model configuration. It would replace/extend the filter_table call: https://github.com/UDST/urbansim/blob/79f815a6503e109f50be270cee92d0f4a34f49ef/urbansim/models/transition.py#L305