{"id":16117081,"url":"https://github.com/mlange-42/arche-model","last_synced_at":"2025-03-17T18:30:37.679Z","repository":{"id":150453634,"uuid":"622942282","full_name":"mlange-42/arche-model","owner":"mlange-42","description":"Everything you need to rapidly build a model with the Arche Entity Component System (ECS).","archived":false,"fork":false,"pushed_at":"2025-01-08T23:19:55.000Z","size":133,"stargazers_count":14,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T03:22:30.825Z","etag":null,"topics":["ecs","entity-component-system","go","golang","individual-based-modelling"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/mlange-42/arche-model","language":"Go","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/mlange-42.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2023-04-03T11:31:59.000Z","updated_at":"2025-01-08T23:18:28.000Z","dependencies_parsed_at":"2024-01-21T21:29:01.640Z","dependency_job_id":"6cc53927-0d1a-4f01-bd5e-3ec9f2d897f3","html_url":"https://github.com/mlange-42/arche-model","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlange-42%2Farche-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlange-42%2Farche-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlange-42%2Farche-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlange-42%2Farche-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlange-42","download_url":"https://codeload.github.com/mlange-42/arche-model/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243878439,"owners_count":20362432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ecs","entity-component-system","go","golang","individual-based-modelling"],"created_at":"2024-10-09T20:28:27.832Z","updated_at":"2025-03-17T18:30:37.316Z","avatar_url":"https://github.com/mlange-42.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arche Model\n\n[![Test status](https://img.shields.io/github/actions/workflow/status/mlange-42/arche-model/tests.yml?branch=main\u0026label=Tests\u0026logo=github)](https://github.com/mlange-42/arche-model/actions/workflows/tests.yml)\n[![Coverage Status](https://coveralls.io/repos/github/mlange-42/arche-model/badge.svg?branch=main)](https://coveralls.io/github/mlange-42/arche-model?branch=main)\n[![Go Report Card](https://goreportcard.com/badge/github.com/mlange-42/arche-model)](https://goreportcard.com/report/github.com/mlange-42/arche-model)\n[![Go Reference](https://pkg.go.dev/badge/github.com/mlange-42/arche-model.svg)](https://pkg.go.dev/github.com/mlange-42/arche-model)\n[![GitHub](https://img.shields.io/badge/github-repo-blue?logo=github)](https://github.com/mlange-42/arche-model)\n[![MIT license](https://img.shields.io/github/license/mlange-42/arche-model)](https://github.com/mlange-42/arche-model/blob/main/LICENSE)\n\n*Arche Model* provides a wrapper around the [Arche](https://github.com/mlange-42/arche) Entity Component System (ECS), and some common systems and resources.\nIt's purpose is to get started with prototyping and developing simulation models immediately, focussing on the model logic.\n\n\u003cdiv align=\"center\"\u003e\n\n\u003ca href=\"https://github.com/mlange-42/arche\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/44003176/236701164-28178d13-7e52-4449-baa4-41b764183cbd.png\" alt=\"Arche (logo)\" width=\"500px\" /\u003e\n\u003c/a\u003e\n\n\u003c/div\u003e\n\n## Features\n\n* Scheduler for running logic and UI systems with independent update rates.\n* Interfaces for ECS systems and observers.\n* Ready-to-use systems for common tasks like writing CSV files or terminating a simulation.\n* Common ECS resources, like central PRNG source or the current model tick.\n\n## Installation\n\n```\ngo get github.com/mlange-42/arche-model\n```\n\n## Usage\n\nSee the [API docs](https://pkg.go.dev/github.com/mlange-42/arche-model) for more details and examples.  \n[![Go Reference](https://pkg.go.dev/badge/github.com/mlange-42/arche-model.svg)](https://pkg.go.dev/github.com/mlange-42/arche-model)\n\n```go\npackage main\n\nimport (\n\t\"github.com/mlange-42/arche-model/model\"\n\t\"github.com/mlange-42/arche-model/system\"\n\t\"github.com/mlange-42/arche/ecs\"\n\t\"github.com/mlange-42/arche/generic\"\n)\n\n// Position component\ntype Position struct {\n\tX float64\n\tY float64\n}\n\n// Velocity component\ntype Velocity struct {\n\tX float64\n\tY float64\n}\n\nfunc main() {\n\t// Create a new, seeded model.\n\tm := model.New().Seed(123)\n\t// Limit simulation speed\n\tm.TPS = 30\n\n\t// Add systems to the model.\n\tm.AddSystem(\u0026VelocitySystem{EntityCount: 1000})\n\t// Add a termination system that ends the simulation.\n\tm.AddSystem(\u0026system.FixedTermination{Steps: 100})\n\n\t// Run the model.\n\tm.Run()\n}\n\n// VelocitySystem is an example system adding velocity to position.\n// For simplicity, it also creates entities during initialization.\ntype VelocitySystem struct {\n\tEntityCount int\n\tfilter      generic.Filter2[Position, Velocity]\n}\n\n// Initialize the system\nfunc (s *VelocitySystem) Initialize(w *ecs.World) {\n\ts.filter = *generic.NewFilter2[Position, Velocity]()\n\n\tmapper := generic.NewMap2[Position, Velocity](w)\n\tmapper.NewBatch(s.EntityCount)\n}\n\n// Update the system\nfunc (s *VelocitySystem) Update(w *ecs.World) {\n\tquery := s.filter.Query(w)\n\n\tfor query.Next() {\n\t\tpos, vel := query.Get()\n\t\tpos.X += vel.X\n\t\tpos.Y += vel.Y\n\t}\n}\n\n// Finalize the system\nfunc (s *VelocitySystem) Finalize(w *ecs.World) {}\n```\n\n## License\n\nThis project is distributed under the [MIT licence](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlange-42%2Farche-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlange-42%2Farche-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlange-42%2Farche-model/lists"}