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

Integrate Hotelling Law Extension into Mesa Examples #120

Merged
merged 30 commits into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1f6e5a0
Add hotelling-law project
aumashankar Apr 5, 2024
6b5b412
Added team details
aumashankar Apr 9, 2024
4daccfc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 9, 2024
486413a
changed import statements
aumashankar Apr 9, 2024
a68b9fb
fixing imports with ruff
aumashankar Apr 9, 2024
e629285
fixing recognizing hotelling_law module by tests
aumashankar Apr 9, 2024
69099bf
fixing imports for recognizing hotelling_law module by tests
aumashankar Apr 9, 2024
0a94531
fixing imports for recognizing hotelling_law module by tests
aumashankar Apr 9, 2024
9bd62d8
fixing import sequence with ruff
aumashankar Apr 9, 2024
e377041
refactored code inline with other examples
aumashankar Apr 11, 2024
30fe6f7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 11, 2024
911a63e
- fixing feedback comment
aumashankar Apr 11, 2024
e853d89
- fixing import
aumashankar Apr 11, 2024
da73a74
- processing feedback comment
aumashankar Apr 11, 2024
245c763
- processing feedback comment
aumashankar Apr 11, 2024
bad1087
- processing feedback comments. integrating mesa3.0 experimental UI
aumashankar Apr 16, 2024
887c2df
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 16, 2024
5954403
fixing lint and import sort issues
aumashankar Apr 16, 2024
8556ce4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 16, 2024
46cec2c
processing feedback
aumashankar Apr 16, 2024
e1251fe
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 16, 2024
3fafddc
Update Readme.md
aumashankar Apr 17, 2024
04d3eed
adopted project structure with other examples, removed relative impor…
Apr 17, 2024
b8af9e2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 17, 2024
a816a8e
Added consumer preferences, market share dynamics to have changes in …
Apr 20, 2024
d7d0de4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 20, 2024
3621d06
fixing lint
Apr 20, 2024
04fc1d3
updated dependencies as per feedback
Apr 20, 2024
8e39a89
chore: fixing dependencies
Apr 20, 2024
532b7bb
chore: removing profile tests
Apr 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions examples/hotelling_law/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Hotelling's Law Mesa Simulation

## Overview

This project is an agent-based model implemented using the Mesa framework in Python. It simulates market dynamics based on Hotelling's Law, exploring the behavior of stores in a competitive market environment. Stores adjust their prices and locations if it's increases market share to maximize revenue, providing insights into the effects of competition and customer behavior on market outcomes.

## Hotelling's Law

Hotelling's Law is an economic theory that predicts competitors in a market will end up in a state of minimum differentiation, often referred to as the "principle of minimum differentiation" or "Hotelling's linear city model". This model explores how businesses choose their location in relation to competitors and how this affects pricing and consumer choice.

## Installation

To run this simulation, you will need Python 3.x and the following Python libraries:

- mesa
- solara
- pandas
- matplotlib
- numpy
- scipy
- jupyter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jupyter is not needed. Everything else is auto-installed when installing mesa, except for scipy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated requirements.txt and Readme.md

Thanks a lot for the review @rht


You can install all required libraries by running:

```bash
pip install -r requirements.txt
```

## Project Structure

```plaintext
mesa-examples/
└── examples/
└── hotelling_law/
├── hotelling_law/
│ ├── __init__.py
│ ├── model.py
│ └── agents.py
├── __init__.py
├── app.py
├── cprofile_test.py
├── Readme.md
├── requirements.txt
└── tests.py
```

## Running the Simulation

To start the simulation, navigate to the project directory and execute the following command:

```bash
solara run app.py
```

# Project Details

### Professor: [Vipin P. Veetil](https://www.vipinveetil.com/)
### Indian Institute of Management, Kozhikode

### Project by

| Group 8 | | |
|-|---------------------------|---------------|
| Name | Email Id | Roll No |
| Amrita Tripathy | amrita15d@iimk.edu.in | EPGP-15D-010 |
| Anirban Mondal | anirban15e@iimk.edu.in | EPGP-15E-006 |
| Namita Das | namita15d@iimk.edu.in | EPGP-15D-046 |
| Sandeep Shenoy | sandeep15c@iimk.edu.in | EPGP-15C-076 |
| Sanjeeb Kumar Dhinda | sanjeeb15d@iimk.edu.in | EPGP-15D-074 |
| Umashankar Ankuri | umashankar15d@iimk.edu.in | EPGP-15D-096 |
| Vinayak Nair | vinayak15d@iimk.edu.in | EPGP-15D-102 |
| Wayne Joseph Unger | wayne15d@iimk.edu.in | EPGP-15D-104 |


### Hotelling Law Simulation - Visualization
![plot](hotelling_law_sim.png)
Empty file.
Loading