{"id":26184452,"url":"https://github.com/lee-seokmin/virtualworld","last_synced_at":"2026-05-04T23:32:49.475Z","repository":{"id":279318361,"uuid":"908439140","full_name":"lee-seokmin/VirtualWorld","owner":"lee-seokmin","description":"🌏 Is the world we live in a simulation?","archived":false,"fork":false,"pushed_at":"2025-02-25T00:00:14.000Z","size":1357,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-30T19:51:59.713Z","etag":null,"topics":["blockchain","crypto","online-bank","online-banking","online-banking-system","ppo","python","pytorch","reinforcement-learning","rsa","simulator","survival"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lee-seokmin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-26T04:44:00.000Z","updated_at":"2025-02-25T00:00:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"f07554f3-ad8a-4ad9-96bf-b255fbd2992e","html_url":"https://github.com/lee-seokmin/VirtualWorld","commit_stats":null,"previous_names":["seokmin12/virtualworld"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lee-seokmin/VirtualWorld","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lee-seokmin%2FVirtualWorld","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lee-seokmin%2FVirtualWorld/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lee-seokmin%2FVirtualWorld/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lee-seokmin%2FVirtualWorld/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lee-seokmin","download_url":"https://codeload.github.com/lee-seokmin/VirtualWorld/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lee-seokmin%2FVirtualWorld/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32628829,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","crypto","online-bank","online-banking","online-banking-system","ppo","python","pytorch","reinforcement-learning","rsa","simulator","survival"],"created_at":"2025-03-11T22:55:58.911Z","updated_at":"2026-05-04T23:32:49.470Z","avatar_url":"https://github.com/lee-seokmin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch3\u003e\n        🎮 Virtual World Simulator\n    \u003c/h3\u003e\n\u003c/div\u003e\n\n---\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\"\u003e\n    \u003c/a\u003e\n    \u003cbr\u003e\n    \u003cimg src=\"https://img.shields.io/badge/python-3776AB?style=for-the-badge\u0026logo=python\u0026logoColor=ffffff\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/pytorch-EE4C2C?style=for-the-badge\u0026logo=python\u0026logoColor=ffffff\"\u003e\n    \u003cbr\u003e\n    \u003ca href=\"./README.md\"\u003e\n        \u003cimg alt=\"README in English\" src=\"https://img.shields.io/badge/English-d9d9d9\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"./README_KR.md\"\u003e\n        \u003cimg alt=\"README in Korean\" src=\"https://img.shields.io/badge/한국어-d9d9d9\"\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n        \u003ca href=\"#introduction\"\u003eIntroduction\u003c/a\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n        \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n        \u003cul\u003e\n            \u003cli\u003e\u003ca href=\"#dependencies\"\u003eDependencies\u003c/a\u003e\u003c/li\u003e\n        \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n        \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\n            \u003cul\u003e\n                \u003cli\u003e\u003ca href=\"#run-training\"\u003eRun Training\u003c/a\u003e\u003c/li\u003e\n                \u003cli\u003e\u003ca href=\"#run-testing\"\u003eRun Testing\u003c/a\u003e\u003c/li\u003e\n                \u003cli\u003e\u003ca href=\"#run-fine-tuning\"\u003eRun Fine Tuning\u003c/a\u003e\u003c/li\u003e\n            \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#project-structure\"\u003eProject Structure\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#model-results\"\u003eModel Results\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n## Introduction\nThe **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?\"*](https://simulation-argument.com/simulation/), arguing that an advanced civilization may have created simulations indistinguishable from reality.\n\nI 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**.\n\nBuilding 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.\n\n## Getting Started\n\n### Dependencies\n```\npip install -r requirements.txt\n```\n\n## Usage\n\n### Run Training\n``` \n# Single Entity\npython train.py --env single\n\n# multi Entity\npython train.py --env multi --num_entities \u003cnum of entities\u003e\n```\n\n### Run Testing\n```\npython test.py --checkpoint \u003cpath_to_trained_model\u003e --episodes \u003cnum of test episodes\u003e\n```\n\n### Run Fine Tuning\n```\npython fine_tune.py --checkpoint \u003cpath_to_trained_model\u003e\n```\n\n## Project Structure\n### Module\n- **[module/Entity.py:](./module/Entity.py)** Defines entities and their actions (mining, resting, leisure, religious activities, transactions).\n- **[module/Account.py:](./module/Account.py)** Defines entity accounts and encryption.\n- **[module/Bank.py:](./module/Bank.py)** Defines a virtual bank and blockchain-based transactions between accounts.\n- **[module/Transaction.py:](./module/Transaction.py)** Manages transaction records and encryption.\n- **[module/StockMarket.py:](./module/StockMarket.py)** Defines a virtual stock market.\n- **[module/Invest/Stock.py:](./module/Invest/Stock.py)** Defines virtual stocks.\n\n### Simulator\n- **[simulator/SimulatorEnv.py:](./simulator/SimulatorEnv.py)** Implements a single-entity simulation environment.\n- **[simulator/MultiEntityEnv.py:](./simulator/MultiEntityEnv.py)** Implements a multi-entity simulation environment.\n\n### Training\n- **[train.py:](./train.py)** Agent training.\n- **[fine_tune.py:](./fine_tune.py)** Supports fine-tuning of the trained model.\n\n## Model Results\n[Results](./PPO_logs/PPO_3/results.csv)\n| Episode | Timestep | Total Mined | Balance | Age | Day | End Reason                  |\n|---------|----------|-------------|---------|-----|-----|-----------------------------|\n| 0       | 73       | 17          | 850     | 20  | 3   | Health depleted             |\n| 1       | 27       | 6           | 300     | 20  | 1   | Happiness depleted          |\n| 2       | 46       | 11          | 550     | 20  | 1   | Health depleted             |\n| 3       | 50       | 9           | 450     | 20  | 2   | Health depleted             |\n| 4       | 200      | 17          | 850     | 20  | 8   | Health depleted             |\n| 5       | 81       | 10          | 500     | 20  | 3   | Health depleted             |\n| ...     | ...      | ...         | ...     | ... | ... | ...                         |\n| 26      | 26       | 13          | 650     | 20  | 1   | Happiness depleted          |\n| 27      | 700800   | 1966        | 98300   | 99  | 29199| Max episode length reached  |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flee-seokmin%2Fvirtualworld","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flee-seokmin%2Fvirtualworld","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flee-seokmin%2Fvirtualworld/lists"}