Table of Contents
The Simulation Hypothesis proposes that the universe we perceive may not be a real, physical world, but rather a vast virtual simulation. This concept was introduced by philosopher Nick Bostrom in his 2003 paper "Are You Living In a Computer Simulation?", arguing that an advanced civilization may have created simulations indistinguishable from reality.
I found this hypothesis fascinating and began exploring whether a similar system could be implemented. Observing how economic systems develop in the real world, I noticed that with the introduction of currency and financial systems, markets emerged, leading to the formation and evolution of nations. If such principles can be applied to digital environments, then the creation of virtual economies and states should also be feasible. In fact, cryptocurrencies like Bitcoin have established borderless financial systems, and concepts of independent economies and virtual states are emerging within the metaverse.
Building on these ideas, I have defined an entity (a human) and constructed an interactive environment in which this entity performs specific actions, learns optimal survival strategies, and strives to live as efficiently and as long as possible. Through this approach, I aim to explore the potential for autonomous evolution within a simulation.
pip install -r requirements.txt
# Single Entity
python train.py --env single
# multi Entity
python train.py --env multi --num_entities <num of entities>
python test.py --checkpoint <path_to_trained_model> --episodes <num of test episodes>
python fine_tune.py --checkpoint <path_to_trained_model>
- module/Entity.py: Defines entities and their actions (mining, resting, leisure, religious activities, transactions).
- module/Account.py: Defines entity accounts and encryption.
- module/Bank.py: Defines a virtual bank and blockchain-based transactions between accounts.
- module/Transaction.py: Manages transaction records and encryption.
- module/StockMarket.py: Defines a virtual stock market.
- module/Invest/Stock.py: Defines virtual stocks.
- simulator/SimulatorEnv.py: Implements a single-entity simulation environment.
- simulator/MultiEntityEnv.py: Implements a multi-entity simulation environment.
- train.py: Agent training.
- fine_tune.py: Supports fine-tuning of the trained model.
| Episode | Timestep | Total Mined | Balance | Age | Day | End Reason |
|---|---|---|---|---|---|---|
| 0 | 73 | 17 | 850 | 20 | 3 | Health depleted |
| 1 | 27 | 6 | 300 | 20 | 1 | Happiness depleted |
| 2 | 46 | 11 | 550 | 20 | 1 | Health depleted |
| 3 | 50 | 9 | 450 | 20 | 2 | Health depleted |
| 4 | 200 | 17 | 850 | 20 | 8 | Health depleted |
| 5 | 81 | 10 | 500 | 20 | 3 | Health depleted |
| ... | ... | ... | ... | ... | ... | ... |
| 26 | 26 | 13 | 650 | 20 | 1 | Happiness depleted |
| 27 | 700800 | 1966 | 98300 | 99 | 29199 | Max episode length reached |