Coder Social home page Coder Social logo

food-bank-network-simulation's People

Contributors

liu-hy avatar lucianli123 avatar rodigu avatar ybull avatar

Stargazers

 avatar

food-bank-network-simulation's Issues

Food class negative subtraction

@Liu-Hy

Food class' subtraction function doesn't seem to account for the case when an order is greater than the available quantity.

Is this the intended behavior?

I should say that I would prefer it to still perform the subtraction (even if we end up with negative quantities) and the negative be handled outside the subtract func.

Related to #20 and #1

Related to #1 and #2

To simulate increased load, it will be necessary to increase households per pantry and food insecure population on FoodBank init

Global Class

Would be useful to have a Global class with our constants and variables that need to be accessed throught the project (like days and food price).

Motivation: better type hinting than dict; organization

Get order function

Is there already a way for the food bank to give the pantry the food asked?

Bug in pantry/food bank interface:

@Liu-Hy : Line 361 of FoodPantry.py returns None if not sunday

@rodigu : Line 46 of FoodBank.py doesn't properly handle None return from pantry.run_one_day

TypeError: cannot unpack non-iterable NoneType object

FoodPantry class

Still need to implement 3 methods

  • hold a pantry event
  • predict the demand in the upcoming event
  • calculate utility

Multiprocessing

The operation of food pantries should be the main computation bottleneck. We can try multiprocessing. My idea is to load the foodbanks into several processes in the simulation file. The global coordination of purchase may be done after that in the main process.

`get_demand` function in `FoodPantry` class

Can @Liu-Hy add a get_demant function that returns the demand for each of the products pls

It can return a dict with keys being the types and values being the demand in weight.
I need the real demand, regardless if ir was met or not. This is to calculate how much of each food the bank will need to buy.

FoodBank budget use

Should we have the pantry save some of the budget it receives?

Or can I spend it entirely on food?

Setting limits for clients

Suppose there are $n$ people and the demand $X$ conforms to the same Beta distribution, with the expectation $\frac{a}{a+b}$. The supply is only $nm$, where $0 \lt m \lt \frac{a}{a+b}$. Set a limit $k$ for everyone such that the expectation of $\operatorname {min}(X, k)$ is exactly $m$.
It does not require much precision. Are there any numeric methods to solve the integral equation, or should I simply look up a table using the monotonicity of the expectation with $k$? For either way, are there any useful toolboxes in R/Matlab/Mathematica?

Main function of Foodbank class

@rodigu, can you implement a main function of foodbank plz? No need to buy or share food, by calling run_one_day(), it receives newly donated food, lets pantries run sequentially, and gets aggregate waste and utility. I hope to have some result on the pantries of a bank before presentation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.