A fictional supermarket has collected time/location data for their customers regarding which isles they visit (and checkout) with a resolution of 1min. A Markov-Chain, describing customer behavior, is extracted from this data and customer behavior is simulated, along with a visual simulation
- Python 3.8 (See requirements.txt for libraries)
/market_data Contains fictional supermarket data, describes position of the customer at an isle, or checkout, resolution 1 min. Entry is implied 1 min before the visit of the first isle
/generated_matrices Contains transition probability matrices generated by transition_probability_generator.py
/sim_ Simulations generated using the transition probability matrices by means of by means of a Monte Carlo Markov Chain Simulation by the SuperMarket class
Discrete Markov Chains describe a memoryless transition process between well defined discrete states. Memoryless, means that the transition probability from state to state depends only on the current state .
Given observations of a system that transitions from a total number of states, is calculated simply as the total number of transitions observed from state to state , divided by total number of transitions from state (including )
Markov State Diagram Depicting Transition ProbabilitiesCurrent Workflow is:
Data Transition Matrices Simulation Visualization.
All modules and scripts are functional, but user options are limited and requires editing the code to select different data and simulation parameters. These will be addressed in future updates.
./calculation_library.py: Contains the SuperMarket(), and Customer() class and helper functions to calculate transition probability matrices from raw data, and simulate customer behaviour from these matrices.
./supermarket_visualization/visualization_library.py: Contains Customer() class, and helper functions to visualize the generated simulation
./supermarket_visualization/visualization_constants.py: Constains constants used in simulation in a VC() class
./supermarket_class_demo: Demostrates making a customer behaviour simulation
./transition_probability_generator.py: Calculates transtition probabilities
./visualize.py: Visualizes the simulation
./make_markov_state_diagram.py: Creates the Markov State Diagram shown on this README
-
pd.concat() in a loop slows down the SuperMarket() class, will be addressed
-
Most file choice parameters, and options are built-in. These need to be moved to sysarg or as class/function parameters
- @AlphanAksoyoglu Alphan Aksoyoglu
- @ai-aksoyoglu Alexandra Irina Aksoyoglu
- @pavrmk Pavel Romanenko
- @lenaromanenko Lena Romanenko
I personally thank the following content creators for making their creations available under the Creative Commons CC-BY-SA 3.0 License
Resource: Dungeon Floor
Creator: Clint Bellanger (pfunked deviantart)
Website: https://www.deviantart.com/pfunked/art/Stone-Dungeon-Floor-122524193
License: https://creativecommons.org/licenses/by-sa/3.0/
Resource: Supermarket Atlas
Creator: Sunisa Thondaengdee
Website: https://opengameart.org/content/supermarket-0
License: https://creativecommons.org/licenses/by-sa/3.0/
Resource: Bricks
Creator: Unknown
Website: http://pixeljoint.com/forum/forum_posts.asp?TID=19369
License: None