{"id":15647479,"url":"https://github.com/umitkaanusta/jomini","last_synced_at":"2025-10-05T15:16:46.057Z","repository":{"id":62572631,"uuid":"259668311","full_name":"umitkaanusta/Jomini","owner":"umitkaanusta","description":"Historical battle simulation package for Python","archived":false,"fork":false,"pushed_at":"2020-08-19T15:36:06.000Z","size":37,"stargazers_count":49,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-16T01:56:59.299Z","etag":null,"topics":["attrition","battle","combat","historical","lanchester","military","military-history","model","modeling","modelling","operations-research","simulation","strategy","strategy-game","strategy-games","tactics","war","war-games","wargaming"],"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/umitkaanusta.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}},"created_at":"2020-04-28T14:56:59.000Z","updated_at":"2025-08-04T22:57:34.000Z","dependencies_parsed_at":"2022-11-03T20:10:59.673Z","dependency_job_id":null,"html_url":"https://github.com/umitkaanusta/Jomini","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/umitkaanusta/Jomini","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umitkaanusta%2FJomini","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umitkaanusta%2FJomini/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umitkaanusta%2FJomini/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umitkaanusta%2FJomini/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umitkaanusta","download_url":"https://codeload.github.com/umitkaanusta/Jomini/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umitkaanusta%2FJomini/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271606351,"owners_count":24788970,"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","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["attrition","battle","combat","historical","lanchester","military","military-history","model","modeling","modelling","operations-research","simulation","strategy","strategy-game","strategy-games","tactics","war","war-games","wargaming"],"created_at":"2024-10-03T12:19:35.637Z","updated_at":"2025-10-05T15:16:41.026Z","avatar_url":"https://github.com/umitkaanusta.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jomini v0.1.4\r\n[![Jomini](https://circleci.com/gh/circleci/circleci-docs.svg?style=svg)](https://circleci.com/gh/umitkaanusta/jomini)\r\n![GitHub license](https://img.shields.io/github/license/Naereen/StrapDown.js.svg)\r\n![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)\r\n\r\n![ForTheBadge built-with-love](http://ForTheBadge.com/images/badges/built-with-love.svg)\r\n\r\nJomini creates military simulations by using mathematical combat models. Designed to be helpful for game developers, students, history enthusiasts and -to some extent- scientists. You can mail me at u.kaanusta@gmail.com if you want to contribute.\r\n\r\n__To download:__ https://pypi.org/project/Jomini\r\n\r\nDocumentation will be available in the next update.\r\n\r\n# Lanchester Models 101\r\nThis package uses the combat models developed by Frederick William Lanchester, a.k.a one of the founding fathers of Operations Research.\r\n\r\n- Lanchester Models are deterministic, which means the model will always yield the same result for the same input parameters.\r\n- Lanchester Models view battles as an attrition model, therefore manuevers and sudden changes during the battle can not be represented.\r\n- You might need to do some manual fine-tuning if you are not able to get quality parameters (rho, beta, engagement_width) from a data set.\r\n- ___Despite the downsides, even the primitive models developed by Lanchester himself works wonders with the right parameters.___ \r\n\r\n## Code Sample: Lanchester's Linear Law\r\n- The Linear Law is based on force concentration\r\n- Good for modelling melee battles and unaimed fire (artillery, arquebus, handcannon etc.) \r\n\r\n```python\r\nfrom jomini.Lanchester import Battle, LinearLaw\r\n\r\n# Re-creating the Battle of Cerignola (AD 1503)\r\n# In the actual battle, Spanish(red) lost 500 men while the French(blue) lost 4000 men\r\n# Parameters rho, beta, engagement_width and time are manually fine_tuned\r\nb = Battle(red=6_300, blue=9_000, rho=0.0800, beta=0.0100)\r\nL = LinearLaw(b, engagement_width=100)\r\nprint(L.get_casualty_rates()) # Returns casualty rates \r\nprint(L.get_casualties(time=7))\r\nprint(L.get_remaining(time=7))\r\nprint(L.simulate_battle(time=7))\r\n```\r\n\r\n![Linear Law](https://i.imgur.com/yjAUK57.png)\r\n\r\n## Code Sample: Visiting models used in Jomini\r\n- __Square Law:__ Given equal power coefficients, the fighting power is proportional to the square of army size.\r\n    - Good for modelling aimed fire (e.g Napoleonic line-battles)\r\n- __Logarithmic Law:__ Basically square law at a larger scale, used by Weiss to model the American Civil War \r\n    - Good for modelling tank combat as well\r\n\r\n\r\n```python\r\nfrom jomini.Lanchester import Battle, LinearLaw, SquareLaw, LogarithmicLaw, GeneralLaw\r\n\r\n# Simulating a fictitious battle with each of the laws\r\nb = Battle(red=20_000, blue=30_000, rho=0.0150, beta=0.0120)\r\nLinear = LinearLaw(b, engagement_width=500)\r\nSquare = SquareLaw(b)\r\nLog = LogarithmicLaw(b)\r\nGeneralized = GeneralLaw(b, engagement_width=500, p=0.450, q=0.600)\r\n\r\n# If time is not specified, the battle goes on until one side is annihilated.\r\nprint(Linear.simulate_battle() + \"\\n\")\r\nprint(Square.simulate_battle() + \"\\n\")\r\nprint(Log.simulate_battle() + \"\\n\")\r\nprint(Generalized.simulate_battle())\r\n```\r\n![Model-1](https://i.imgur.com/Uoz9bz4.png)\r\n![Model-2](https://i.imgur.com/9XlE6aA.png)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumitkaanusta%2Fjomini","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumitkaanusta%2Fjomini","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumitkaanusta%2Fjomini/lists"}