diff --git a/.formatter.exs b/.formatter.exs deleted file mode 100644 index d2cda26..0000000 --- a/.formatter.exs +++ /dev/null @@ -1,4 +0,0 @@ -# Used by "mix format" -[ - inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] -] diff --git a/chatgpt.exs b/chatgpt.exs index 0ea9ff0..40589a3 100644 --- a/chatgpt.exs +++ b/chatgpt.exs @@ -1,88 +1,163 @@ -# Installer Jason pour JSON si besoin Mix.install([ - {:jason, "~> 1.4"} + {:jason, "~> 1.4"}, + {:matplotex, "~> 0.4.71"} ]) defmodule ZombieApocalypse do + @moduledoc """ + Simulation zombie complète. + + - Chaque zombie a un niveau de faim. + - Faim augmente de 5 chaque heure. + - Si un zombie mange un humain, sa faim revient à 0 et l'humain devient un zombie. + - Certains zombies peuvent mourir. + - Sauvegarde JSON à chaque heure. + - Affichage dans le terminal avec pourcentages. + - Génération graphique final avec Matplotex. + """ + @state_file "states.json" - @final_file "states_final.json" + # ===================================== # Démarrage de la simulation - def start(humans \\ 10, zombies \\ 3, max_hours \\ 200) do - # Vider le fichier temporaire - File.write!(@state_file, "") + # ===================================== + def start(humans \\ 10, zombies \\ 3, max_hours \\ 100) do + File.write!(@state_file, "[]") + IO.puts("🧟 Lancement de la simulation...") - IO.puts("🧟 Lancement de la simulation Zombie Apocalypse !") + zombie_list = for _ <- 1..max(zombies, 0), do: 0 - # Ouvrir le fichier en continu pour append rapide - {:ok, file} = File.open(@state_file, [:write, :utf8]) + loop(0, humans, zombie_list, max_hours, humans, zombies) - # Boucle principale - loop(0, humans, zombies, max_hours, file) - - # Fermer le fichier - File.close(file) - - # Générer JSON final - finalize_json() + # Génération graphique + plot_final() + IO.puts("✅ Simulation terminée. JSON et graphique générés (zombie_final.png).") end + # ===================================== # Boucle principale - defp loop(hour, humans, zombies, max_hours, file) when hour < max_hours do + # ===================================== + defp loop(hour, humans, zombie_list, max_hours, initial_humans, initial_zombies) + when hour < max_hours do state = %{ hour: hour, humans: humans, - zombies: zombies, + zombies: length(zombie_list), timestamp: DateTime.utc_now() } - # Append rapide - IO.write(file, Jason.encode!(state) <> "\n") + append_state(state) - # Afficher seulement toutes les 10 heures - if rem(hour, 10) == 0 do - IO.puts("Heure #{hour} | Humains: #{humans} | Zombies: #{zombies}") - end + percent_humans = + if initial_humans > 0, do: humans / initial_humans * 100, else: 0 + + percent_zombies = + if initial_zombies > 0, do: length(zombie_list) / initial_zombies * 100, else: 0 + + IO.puts( + "Heure #{hour} : Humains = #{humans} (#{Float.round(percent_humans, 1)}%), " <> + "Zombies = #{length(zombie_list)} (#{Float.round(percent_zombies, 1)}%)" + ) cond do - humans <= 0 -> - IO.puts("💀 Tous les humains ont été infectés.") - - zombies <= 0 -> - IO.puts("🎉 Tous les zombies ont été éliminés.") + humans <= 0 or length(zombie_list) == 0 -> + {humans, zombie_list} true -> - {new_humans, new_zombies} = simulate_hour(humans, zombies) - loop(hour + 1, new_humans, new_zombies, max_hours, file) + {new_humans, new_zombies} = simulate_hour(humans, zombie_list) + loop(hour + 1, new_humans, new_zombies, max_hours, initial_humans, initial_zombies) end end - defp loop(_hour, _humans, _zombies, _max_hours, _file), do: :ok + defp loop(_, humans, zombie_list, _, _, _), do: {humans, zombie_list} - # Simulation d'une heure (calcul probabiliste) - defp simulate_hour(humans, zombies) do - attacks = zombies - # Humains infectés : chaque attaque a 40% de chance - humans_lost = Enum.count(1..attacks, fn _ -> :rand.uniform(100) <= 40 end) - # Zombies tués : chaque attaque a 15% de chance - zombies_lost = Enum.count(1..attacks, fn _ -> :rand.uniform(100) <= 15 end) + # ===================================== + # Simulation d'une heure + # ===================================== + defp simulate_hour(humans, zombie_list) do + new_zombie_list = Enum.map(zombie_list, &(&1 + 5)) - humans = max(humans - humans_lost, 0) - zombies = max(zombies - zombies_lost + humans_lost, 0) # infections - {humans, zombies} + {remaining_humans, zombies_after_hour} = + Enum.reduce(new_zombie_list, {humans, []}, fn hunger, {hum_left, acc} -> + if hum_left > 0 and :rand.uniform() <= 0.4 + hunger / 100 do + # zombie mange humain → nouveau zombie + {hum_left - 1, [0, 0 | acc]} + else + {hum_left, [hunger | acc]} + end + end) + + # Certains zombies peuvent mourir + killed = Enum.count(zombies_after_hour, fn _ -> :rand.uniform() <= 0.15 end) + final_zombies = Enum.drop(zombies_after_hour, killed) + + {remaining_humans, final_zombies} end - # Générer le JSON final complet - defp finalize_json do + # ===================================== + # Sauvegarde JSON + # ===================================== + defp append_state(state) do states = - File.stream!(@state_file) - |> Stream.map(&Jason.decode!/1) - |> Enum.to_list() + File.read!(@state_file) + |> Jason.decode!() - File.write!(@final_file, Jason.encode!(states, pretty: true)) - IO.puts("✅ JSON final créé : #{@final_file}") + File.write!(@state_file, Jason.encode!(states ++ [state], pretty: false)) + end + + # ===================================== + # Graphique final + # ===================================== + defp plot_final do + states = + File.read!(@state_file) + |> Jason.decode!() + + humans = Enum.map(states, & &1["humans"]) |> Enum.filter(&is_number/1) + zombies = Enum.map(states, & &1["zombies"]) |> Enum.filter(&is_number/1) + hours = Enum.map(states, & &1["hour"]) |> Enum.filter(&is_number/1) + + if length(hours) > 0 and length(humans) == length(hours) and length(zombies) == length(hours) do + infection_rate = + if length(humans) >= 2 do + humans + |> Enum.chunk_every(2, 1, :discard) + |> Enum.map(fn [prev, next] -> prev - next end) + else + [] + end + + inf_hours = Enum.drop(hours, 1) + + fig = Matplotex.plot(hours, humans, color: "blue", label: "Humains") + fig = Matplotex.plot(fig, hours, zombies, color: "red", label: "Zombies") + + if infection_rate != [] and length(inf_hours) == length(infection_rate) do + fig = + Matplotex.plot(fig, inf_hours, infection_rate, + color: "green", + label: "Vélocité Infection" + ) + end + + fig_opts = %{figsize: {8, 5}} + fig = Matplotex.figure(fig, fig_opts) + fig = Matplotex.set_title(fig, "Simulation Zombie Apocalypse") + fig = Matplotex.set_xlabel(fig, "Heure") + fig = Matplotex.set_ylabel(fig, "Population / Infection rate") + + svg = Matplotex.show(fig) + File.write!("zombie_final.svg", svg) + System.cmd("rsvg-convert", ["zombie_final.svg", "-o", "zombie_final.png"]) + + IO.puts("🖼️ Graphique généré : zombie_final.png") + else + IO.puts("⚠️ Données insuffisantes pour tracer le graphique.") + end end end -# Lancer la simulation -ZombieApocalypse.start(7000000000, 3, 200) +# ===================================== +# Lancement +# ===================================== +ZombieApocalypse.start(10_000_000, 3, 100) diff --git a/flake.nix b/flake.nix index 350b28e..736bf32 100644 --- a/flake.nix +++ b/flake.nix @@ -25,6 +25,8 @@ elixir erlang elixir-ls + + librsvg ]; shellHook = '' diff --git a/states.json b/states.json index d86e508..7662f14 100644 --- a/states.json +++ b/states.json @@ -1,82 +1 @@ -{"timestamp":"2026-01-06T11:29:46.889794Z","hour":0,"humans":7000000000,"zombies":3} -{"timestamp":"2026-01-06T11:29:46.901248Z","hour":1,"humans":7000000000,"zombies":3} -{"timestamp":"2026-01-06T11:29:46.901292Z","hour":2,"humans":7000000000,"zombies":2} -{"timestamp":"2026-01-06T11:29:46.901310Z","hour":3,"humans":6999999998,"zombies":4} -{"timestamp":"2026-01-06T11:29:46.901324Z","hour":4,"humans":6999999997,"zombies":5} -{"timestamp":"2026-01-06T11:29:46.901343Z","hour":5,"humans":6999999995,"zombies":7} -{"timestamp":"2026-01-06T11:29:46.901356Z","hour":6,"humans":6999999992,"zombies":9} -{"timestamp":"2026-01-06T11:29:46.901376Z","hour":7,"humans":6999999987,"zombies":13} -{"timestamp":"2026-01-06T11:29:46.901403Z","hour":8,"humans":6999999984,"zombies":15} -{"timestamp":"2026-01-06T11:29:46.901420Z","hour":9,"humans":6999999981,"zombies":16} -{"timestamp":"2026-01-06T11:29:46.901434Z","hour":10,"humans":6999999969,"zombies":24} -{"timestamp":"2026-01-06T11:29:46.901477Z","hour":11,"humans":6999999961,"zombies":31} -{"timestamp":"2026-01-06T11:29:46.901499Z","hour":12,"humans":6999999950,"zombies":36} -{"timestamp":"2026-01-06T11:29:46.901515Z","hour":13,"humans":6999999939,"zombies":43} -{"timestamp":"2026-01-06T11:29:46.901536Z","hour":14,"humans":6999999915,"zombies":61} -{"timestamp":"2026-01-06T11:29:46.901570Z","hour":15,"humans":6999999889,"zombies":80} -{"timestamp":"2026-01-06T11:29:46.901595Z","hour":16,"humans":6999999859,"zombies":95} -{"timestamp":"2026-01-06T11:29:46.901627Z","hour":17,"humans":6999999823,"zombies":112} -{"timestamp":"2026-01-06T11:29:46.901664Z","hour":18,"humans":6999999779,"zombies":138} -{"timestamp":"2026-01-06T11:29:46.901705Z","hour":19,"humans":6999999727,"zombies":168} -{"timestamp":"2026-01-06T11:29:46.901754Z","hour":20,"humans":6999999658,"zombies":212} -{"timestamp":"2026-01-06T11:29:46.901825Z","hour":21,"humans":6999999571,"zombies":260} -{"timestamp":"2026-01-06T11:29:46.901867Z","hour":22,"humans":6999999467,"zombies":327} -{"timestamp":"2026-01-06T11:29:46.901910Z","hour":23,"humans":6999999352,"zombies":391} -{"timestamp":"2026-01-06T11:29:46.901961Z","hour":24,"humans":6999999192,"zombies":497} -{"timestamp":"2026-01-06T11:29:46.902029Z","hour":25,"humans":6999998996,"zombies":619} -{"timestamp":"2026-01-06T11:29:46.902104Z","hour":26,"humans":6999998751,"zombies":777} -{"timestamp":"2026-01-06T11:29:46.902193Z","hour":27,"humans":6999998435,"zombies":973} -{"timestamp":"2026-01-06T11:29:46.902304Z","hour":28,"humans":6999998031,"zombies":1227} -{"timestamp":"2026-01-06T11:29:46.902441Z","hour":29,"humans":6999997529,"zombies":1553} -{"timestamp":"2026-01-06T11:29:46.902610Z","hour":30,"humans":6999996944,"zombies":1902} -{"timestamp":"2026-01-06T11:29:46.902834Z","hour":31,"humans":6999996184,"zombies":2376} -{"timestamp":"2026-01-06T11:29:46.903219Z","hour":32,"humans":6999995235,"zombies":3003} -{"timestamp":"2026-01-06T11:29:46.903663Z","hour":33,"humans":6999994085,"zombies":3718} -{"timestamp":"2026-01-06T11:29:46.904074Z","hour":34,"humans":6999992596,"zombies":4620} -{"timestamp":"2026-01-06T11:29:46.904587Z","hour":35,"humans":6999990784,"zombies":5719} -{"timestamp":"2026-01-06T11:29:46.905224Z","hour":36,"humans":6999988428,"zombies":7241} -{"timestamp":"2026-01-06T11:29:46.906018Z","hour":37,"humans":6999985488,"zombies":9119} -{"timestamp":"2026-01-06T11:29:46.906996Z","hour":38,"humans":6999981796,"zombies":11446} -{"timestamp":"2026-01-06T11:29:46.908244Z","hour":39,"humans":6999977121,"zombies":14319} -{"timestamp":"2026-01-06T11:29:46.910018Z","hour":40,"humans":6999971342,"zombies":17920} -{"timestamp":"2026-01-06T11:29:46.912171Z","hour":41,"humans":6999964088,"zombies":22450} -{"timestamp":"2026-01-06T11:29:46.914781Z","hour":42,"humans":6999955200,"zombies":27995} -{"timestamp":"2026-01-06T11:29:46.917810Z","hour":43,"humans":6999944041,"zombies":35046} -{"timestamp":"2026-01-06T11:29:46.921504Z","hour":44,"humans":6999930025,"zombies":43836} -{"timestamp":"2026-01-06T11:29:46.926716Z","hour":45,"humans":6999912528,"zombies":54693} -{"timestamp":"2026-01-06T11:29:46.932908Z","hour":46,"humans":6999890756,"zombies":68219} -{"timestamp":"2026-01-06T11:29:46.940147Z","hour":47,"humans":6999863569,"zombies":85278} -{"timestamp":"2026-01-06T11:29:46.949767Z","hour":48,"humans":6999829576,"zombies":106415} -{"timestamp":"2026-01-06T11:29:46.961107Z","hour":49,"humans":6999787106,"zombies":133008} -{"timestamp":"2026-01-06T11:29:46.975045Z","hour":50,"humans":6999733922,"zombies":166182} -{"timestamp":"2026-01-06T11:29:46.994705Z","hour":51,"humans":6999667271,"zombies":207833} -{"timestamp":"2026-01-06T11:29:47.017118Z","hour":52,"humans":6999583990,"zombies":259742} -{"timestamp":"2026-01-06T11:29:47.044484Z","hour":53,"humans":6999480643,"zombies":324071} -{"timestamp":"2026-01-06T11:29:47.078126Z","hour":54,"humans":6999351277,"zombies":404594} -{"timestamp":"2026-01-06T11:29:47.121004Z","hour":55,"humans":6999188952,"zombies":506411} -{"timestamp":"2026-01-06T11:29:47.173710Z","hour":56,"humans":6998986235,"zombies":633223} -{"timestamp":"2026-01-06T11:29:47.240462Z","hour":57,"humans":6998733592,"zombies":789969} -{"timestamp":"2026-01-06T11:29:47.325410Z","hour":58,"humans":6998418010,"zombies":986673} -{"timestamp":"2026-01-06T11:29:47.430391Z","hour":59,"humans":6998024162,"zombies":1232640} -{"timestamp":"2026-01-06T11:29:47.567925Z","hour":60,"humans":6997531014,"zombies":1541167} -{"timestamp":"2026-01-06T11:29:47.739372Z","hour":61,"humans":6996915048,"zombies":1925949} -{"timestamp":"2026-01-06T11:29:47.949584Z","hour":62,"humans":6996144532,"zombies":2407419} -{"timestamp":"2026-01-06T11:29:48.216272Z","hour":63,"humans":6995182394,"zombies":3007606} -{"timestamp":"2026-01-06T11:29:48.548760Z","hour":64,"humans":6993978917,"zombies":3760074} -{"timestamp":"2026-01-06T11:29:48.982127Z","hour":65,"humans":6992474175,"zombies":4700526} -{"timestamp":"2026-01-06T11:29:49.549035Z","hour":66,"humans":6990594503,"zombies":5874136} -{"timestamp":"2026-01-06T11:29:50.265775Z","hour":67,"humans":6988246428,"zombies":7340299} -{"timestamp":"2026-01-06T11:29:51.190449Z","hour":68,"humans":6985307033,"zombies":9179224} -{"timestamp":"2026-01-06T11:29:52.377333Z","hour":69,"humans":6981636351,"zombies":11471462} -{"timestamp":"2026-01-06T11:29:53.770680Z","hour":70,"humans":6977048363,"zombies":14337618} -{"timestamp":"2026-01-06T11:29:55.459667Z","hour":71,"humans":6971310897,"zombies":17922085} -{"timestamp":"2026-01-06T11:29:57.552975Z","hour":72,"humans":6964144087,"zombies":22402087} -{"timestamp":"2026-01-06T11:30:00.170113Z","hour":73,"humans":6955182481,"zombies":28001066} -{"timestamp":"2026-01-06T11:30:03.456462Z","hour":74,"humans":6943981810,"zombies":34999886} -{"timestamp":"2026-01-06T11:30:07.702079Z","hour":75,"humans":6929981054,"zombies":43752405} -{"timestamp":"2026-01-06T11:30:13.882518Z","hour":76,"humans":6912478647,"zombies":54689218} -{"timestamp":"2026-01-06T11:30:22.015179Z","hour":77,"humans":6890596914,"zombies":68366905} -{"timestamp":"2026-01-06T11:30:31.272590Z","hour":78,"humans":6863257782,"zombies":85453176} -{"timestamp":"2026-01-06T11:30:42.321339Z","hour":79,"humans":6829079144,"zombies":106814388} -{"timestamp":"2026-01-06T11:30:56.415154Z","hour":80,"humans":6786359866,"zombies":133517289} -{"timestamp":"2026-01-06T11:31:14.102785Z","hour":81,"humans":6732956038,"zombies":166893424} +[{"hour":0,"humans":10000000,"timestamp":"2026-01-06T13:03:12.229421Z","zombies":3},{"hour":1,"humans":10000000,"timestamp":"2026-01-06T13:03:12.244572Z","zombies":3},{"hour":2,"humans":10000000,"timestamp":"2026-01-06T13:03:12.244840Z","zombies":1},{"hour":3,"humans":10000000,"timestamp":"2026-01-06T13:03:12.244963Z","zombies":1},{"hour":4,"humans":9999999,"timestamp":"2026-01-06T13:03:12.245071Z","zombies":2},{"hour":5,"humans":9999998,"timestamp":"2026-01-06T13:03:12.245179Z","zombies":3},{"hour":6,"humans":9999998,"timestamp":"2026-01-06T13:03:12.245290Z","zombies":3},{"hour":7,"humans":9999996,"timestamp":"2026-01-06T13:03:12.245434Z","zombies":4},{"hour":8,"humans":9999996,"timestamp":"2026-01-06T13:03:12.245583Z","zombies":3},{"hour":9,"humans":9999995,"timestamp":"2026-01-06T13:03:12.245713Z","zombies":4},{"hour":10,"humans":9999992,"timestamp":"2026-01-06T13:03:12.245826Z","zombies":7},{"hour":11,"humans":9999989,"timestamp":"2026-01-06T13:03:12.245948Z","zombies":10},{"hour":12,"humans":9999983,"timestamp":"2026-01-06T13:03:12.246066Z","zombies":12},{"hour":13,"humans":9999977,"timestamp":"2026-01-06T13:03:12.246177Z","zombies":17},{"hour":14,"humans":9999966,"timestamp":"2026-01-06T13:03:12.246306Z","zombies":25},{"hour":15,"humans":9999951,"timestamp":"2026-01-06T13:03:12.246426Z","zombies":35},{"hour":16,"humans":9999932,"timestamp":"2026-01-06T13:03:12.246549Z","zombies":46},{"hour":17,"humans":9999912,"timestamp":"2026-01-06T13:03:12.246689Z","zombies":51},{"hour":18,"humans":9999881,"timestamp":"2026-01-06T13:03:12.246829Z","zombies":71},{"hour":19,"humans":9999847,"timestamp":"2026-01-06T13:03:12.247008Z","zombies":89},{"hour":20,"humans":9999807,"timestamp":"2026-01-06T13:03:12.247168Z","zombies":110},{"hour":21,"humans":9999759,"timestamp":"2026-01-06T13:03:12.247336Z","zombies":140},{"hour":22,"humans":9999695,"timestamp":"2026-01-06T13:03:12.247509Z","zombies":174},{"hour":23,"humans":9999603,"timestamp":"2026-01-06T13:03:12.247746Z","zombies":224},{"hour":24,"humans":9999500,"timestamp":"2026-01-06T13:03:12.247998Z","zombies":275},{"hour":25,"humans":9999373,"timestamp":"2026-01-06T13:03:12.248282Z","zombies":346},{"hour":26,"humans":9999204,"timestamp":"2026-01-06T13:03:12.248686Z","zombies":447},{"hour":27,"humans":9998986,"timestamp":"2026-01-06T13:03:12.249337Z","zombies":556},{"hour":28,"humans":9998738,"timestamp":"2026-01-06T13:03:12.250268Z","zombies":689},{"hour":29,"humans":9998382,"timestamp":"2026-01-06T13:03:12.251187Z","zombies":909},{"hour":30,"humans":9997950,"timestamp":"2026-01-06T13:03:12.251806Z","zombies":1137},{"hour":31,"humans":9997394,"timestamp":"2026-01-06T13:03:12.252289Z","zombies":1430},{"hour":32,"humans":9996700,"timestamp":"2026-01-06T13:03:12.252786Z","zombies":1801},{"hour":33,"humans":9995846,"timestamp":"2026-01-06T13:03:12.253580Z","zombies":2248},{"hour":34,"humans":9994775,"timestamp":"2026-01-06T13:03:12.255179Z","zombies":2778},{"hour":35,"humans":9993467,"timestamp":"2026-01-06T13:03:12.256293Z","zombies":3448},{"hour":36,"humans":9991821,"timestamp":"2026-01-06T13:03:12.257459Z","zombies":4334},{"hour":37,"humans":9989690,"timestamp":"2026-01-06T13:03:12.259207Z","zombies":5449},{"hour":38,"humans":9987191,"timestamp":"2026-01-06T13:03:12.260416Z","zombies":6714},{"hour":39,"humans":9984051,"timestamp":"2026-01-06T13:03:12.261889Z","zombies":8309},{"hour":40,"humans":9980071,"timestamp":"2026-01-06T13:03:12.263856Z","zombies":10439},{"hour":41,"humans":9975065,"timestamp":"2026-01-06T13:03:12.269086Z","zombies":13175},{"hour":42,"humans":9968863,"timestamp":"2026-01-06T13:03:12.272941Z","zombies":16538},{"hour":43,"humans":9960897,"timestamp":"2026-01-06T13:03:12.276752Z","zombies":20824},{"hour":44,"humans":9951088,"timestamp":"2026-01-06T13:03:12.281605Z","zombies":26094},{"hour":45,"humans":9938714,"timestamp":"2026-01-06T13:03:12.292027Z","zombies":32610},{"hour":46,"humans":9923306,"timestamp":"2026-01-06T13:03:12.301141Z","zombies":40897},{"hour":47,"humans":9903781,"timestamp":"2026-01-06T13:03:12.311698Z","zombies":51424},{"hour":48,"humans":9879237,"timestamp":"2026-01-06T13:03:12.328533Z","zombies":64449},{"hour":49,"humans":9848630,"timestamp":"2026-01-06T13:03:12.356184Z","zombies":80589},{"hour":50,"humans":9810361,"timestamp":"2026-01-06T13:03:12.377479Z","zombies":101022},{"hour":51,"humans":9762582,"timestamp":"2026-01-06T13:03:12.413216Z","zombies":126476},{"hour":52,"humans":9702606,"timestamp":"2026-01-06T13:03:12.458715Z","zombies":158629},{"hour":53,"humans":9627633,"timestamp":"2026-01-06T13:03:12.512304Z","zombies":198462},{"hour":54,"humans":9532986,"timestamp":"2026-01-06T13:03:12.578030Z","zombies":249148},{"hour":55,"humans":9414612,"timestamp":"2026-01-06T13:03:12.650610Z","zombies":312484},{"hour":56,"humans":9266177,"timestamp":"2026-01-06T13:03:12.757576Z","zombies":391826},{"hour":57,"humans":9079879,"timestamp":"2026-01-06T13:03:12.888450Z","zombies":491739},{"hour":58,"humans":8845616,"timestamp":"2026-01-06T13:03:13.063785Z","zombies":617112},{"hour":59,"humans":8551345,"timestamp":"2026-01-06T13:03:13.261404Z","zombies":774936},{"hour":60,"humans":8182867,"timestamp":"2026-01-06T13:03:13.574562Z","zombies":971588},{"hour":61,"humans":7720729,"timestamp":"2026-01-06T13:03:13.961153Z","zombies":1218493},{"hour":62,"humans":7142029,"timestamp":"2026-01-06T13:03:14.459197Z","zombies":1527709},{"hour":63,"humans":6415084,"timestamp":"2026-01-06T13:03:15.087293Z","zombies":1915509},{"hour":64,"humans":5504841,"timestamp":"2026-01-06T13:03:15.890527Z","zombies":2401179},{"hour":65,"humans":4362452,"timestamp":"2026-01-06T13:03:16.744407Z","zombies":3012039},{"hour":66,"humans":2929316,"timestamp":"2026-01-06T13:03:18.028834Z","zombies":3778002},{"hour":67,"humans":1132728,"timestamp":"2026-01-06T13:03:19.968161Z","zombies":4737336},{"timestamp":"2026-01-06T13:03:21.779691Z","hour":68,"humans":0,"zombies":4989869}] \ No newline at end of file diff --git a/states_final.json b/states_final.json index 6ca9963..86c61d4 100644 --- a/states_final.json +++ b/states_final.json @@ -1,38 +1,356 @@ [ { "hour": 0, - "humans": 10, - "timestamp": "2026-01-06T11:18:27.762962Z", + "humans": 5000000, + "timestamp": "2026-01-06T12:14:41.180887Z", "zombies": 3 }, { "hour": 1, - "humans": 10, - "timestamp": "2026-01-06T11:18:27.823728Z", + "humans": 5000000, + "timestamp": "2026-01-06T12:14:41.188896Z", "zombies": 3 }, { "hour": 2, - "humans": 8, - "timestamp": "2026-01-06T11:18:27.874694Z", + "humans": 4999998, + "timestamp": "2026-01-06T12:14:41.188929Z", "zombies": 5 }, { "hour": 3, - "humans": 6, - "timestamp": "2026-01-06T11:18:27.925686Z", + "humans": 4999996, + "timestamp": "2026-01-06T12:14:41.188949Z", "zombies": 7 }, { "hour": 4, - "humans": 3, - "timestamp": "2026-01-06T11:18:27.976690Z", - "zombies": 10 + "humans": 4999993, + "timestamp": "2026-01-06T12:14:41.188963Z", + "zombies": 9 }, { "hour": 5, - "humans": -3, - "timestamp": "2026-01-06T11:18:28.027762Z", - "zombies": 15 + "humans": 4999990, + "timestamp": "2026-01-06T12:14:41.188984Z", + "zombies": 11 + }, + { + "hour": 6, + "humans": 4999983, + "timestamp": "2026-01-06T12:14:41.189001Z", + "zombies": 17 + }, + { + "hour": 7, + "humans": 4999975, + "timestamp": "2026-01-06T12:14:41.189020Z", + "zombies": 23 + }, + { + "hour": 8, + "humans": 4999961, + "timestamp": "2026-01-06T12:14:41.189040Z", + "zombies": 32 + }, + { + "hour": 9, + "humans": 4999948, + "timestamp": "2026-01-06T12:14:41.189075Z", + "zombies": 37 + }, + { + "hour": 10, + "humans": 4999931, + "timestamp": "2026-01-06T12:14:41.189109Z", + "zombies": 45 + }, + { + "hour": 11, + "humans": 4999910, + "timestamp": "2026-01-06T12:14:41.189157Z", + "zombies": 60 + }, + { + "hour": 12, + "humans": 4999885, + "timestamp": "2026-01-06T12:14:41.189188Z", + "zombies": 67 + }, + { + "hour": 13, + "humans": 4999845, + "timestamp": "2026-01-06T12:14:41.189218Z", + "zombies": 92 + }, + { + "hour": 14, + "humans": 4999803, + "timestamp": "2026-01-06T12:14:41.189268Z", + "zombies": 116 + }, + { + "hour": 15, + "humans": 4999747, + "timestamp": "2026-01-06T12:14:41.189316Z", + "zombies": 149 + }, + { + "hour": 16, + "humans": 4999659, + "timestamp": "2026-01-06T12:14:41.189366Z", + "zombies": 202 + }, + { + "hour": 17, + "humans": 4999563, + "timestamp": "2026-01-06T12:14:41.189412Z", + "zombies": 249 + }, + { + "hour": 18, + "humans": 4999444, + "timestamp": "2026-01-06T12:14:41.189465Z", + "zombies": 324 + }, + { + "hour": 19, + "humans": 4999288, + "timestamp": "2026-01-06T12:14:41.189529Z", + "zombies": 413 + }, + { + "hour": 20, + "humans": 4999096, + "timestamp": "2026-01-06T12:14:41.189635Z", + "zombies": 512 + }, + { + "hour": 21, + "humans": 4998841, + "timestamp": "2026-01-06T12:14:41.189864Z", + "zombies": 636 + }, + { + "hour": 22, + "humans": 4998553, + "timestamp": "2026-01-06T12:14:41.189989Z", + "zombies": 772 + }, + { + "hour": 23, + "humans": 4998179, + "timestamp": "2026-01-06T12:14:41.190176Z", + "zombies": 981 + }, + { + "hour": 24, + "humans": 4997721, + "timestamp": "2026-01-06T12:14:41.190360Z", + "zombies": 1245 + }, + { + "hour": 25, + "humans": 4997118, + "timestamp": "2026-01-06T12:14:41.190594Z", + "zombies": 1568 + }, + { + "hour": 26, + "humans": 4996382, + "timestamp": "2026-01-06T12:14:41.190901Z", + "zombies": 1954 + }, + { + "hour": 27, + "humans": 4995446, + "timestamp": "2026-01-06T12:14:41.191312Z", + "zombies": 2425 + }, + { + "hour": 28, + "humans": 4994294, + "timestamp": "2026-01-06T12:14:41.191968Z", + "zombies": 3052 + }, + { + "hour": 29, + "humans": 4992830, + "timestamp": "2026-01-06T12:14:41.192710Z", + "zombies": 3834 + }, + { + "hour": 30, + "humans": 4990950, + "timestamp": "2026-01-06T12:14:41.194421Z", + "zombies": 4869 + }, + { + "hour": 31, + "humans": 4988664, + "timestamp": "2026-01-06T12:14:41.196273Z", + "zombies": 6024 + }, + { + "hour": 32, + "humans": 4985753, + "timestamp": "2026-01-06T12:14:41.197687Z", + "zombies": 7587 + }, + { + "hour": 33, + "humans": 4982215, + "timestamp": "2026-01-06T12:14:41.199289Z", + "zombies": 9390 + }, + { + "hour": 34, + "humans": 4977787, + "timestamp": "2026-01-06T12:14:41.201555Z", + "zombies": 11751 + }, + { + "hour": 35, + "humans": 4972174, + "timestamp": "2026-01-06T12:14:41.203873Z", + "zombies": 14819 + }, + { + "hour": 36, + "humans": 4965252, + "timestamp": "2026-01-06T12:14:41.207054Z", + "zombies": 18508 + }, + { + "hour": 37, + "humans": 4956468, + "timestamp": "2026-01-06T12:14:41.213896Z", + "zombies": 23339 + }, + { + "hour": 38, + "humans": 4945253, + "timestamp": "2026-01-06T12:14:41.219102Z", + "zombies": 29327 + }, + { + "hour": 39, + "humans": 4931259, + "timestamp": "2026-01-06T12:14:41.227398Z", + "zombies": 36780 + }, + { + "hour": 40, + "humans": 4913827, + "timestamp": "2026-01-06T12:14:41.236964Z", + "zombies": 46208 + }, + { + "hour": 41, + "humans": 4892019, + "timestamp": "2026-01-06T12:14:41.252259Z", + "zombies": 57797 + }, + { + "hour": 42, + "humans": 4864582, + "timestamp": "2026-01-06T12:14:41.265113Z", + "zombies": 72434 + }, + { + "hour": 43, + "humans": 4830165, + "timestamp": "2026-01-06T12:14:41.282722Z", + "zombies": 90838 + }, + { + "hour": 44, + "humans": 4786828, + "timestamp": "2026-01-06T12:14:41.305416Z", + "zombies": 114058 + }, + { + "hour": 45, + "humans": 4732682, + "timestamp": "2026-01-06T12:14:41.344774Z", + "zombies": 142846 + }, + { + "hour": 46, + "humans": 4665123, + "timestamp": "2026-01-06T12:14:41.382320Z", + "zombies": 178719 + }, + { + "hour": 47, + "humans": 4580281, + "timestamp": "2026-01-06T12:14:41.432100Z", + "zombies": 224117 + }, + { + "hour": 48, + "humans": 4473784, + "timestamp": "2026-01-06T12:14:41.499129Z", + "zombies": 281086 + }, + { + "hour": 49, + "humans": 4340194, + "timestamp": "2026-01-06T12:14:41.584992Z", + "zombies": 352257 + }, + { + "hour": 50, + "humans": 4173153, + "timestamp": "2026-01-06T12:14:41.690964Z", + "zombies": 441440 + }, + { + "hour": 51, + "humans": 3962221, + "timestamp": "2026-01-06T12:14:41.811665Z", + "zombies": 554491 + }, + { + "hour": 52, + "humans": 3698707, + "timestamp": "2026-01-06T12:14:41.964906Z", + "zombies": 695545 + }, + { + "hour": 53, + "humans": 3368228, + "timestamp": "2026-01-06T12:14:42.159879Z", + "zombies": 872160 + }, + { + "hour": 54, + "humans": 2953399, + "timestamp": "2026-01-06T12:14:42.424475Z", + "zombies": 1093196 + }, + { + "hour": 55, + "humans": 2432909, + "timestamp": "2026-01-06T12:14:42.785990Z", + "zombies": 1370897 + }, + { + "hour": 56, + "humans": 1780644, + "timestamp": "2026-01-06T12:14:43.164048Z", + "zombies": 1718976 + }, + { + "hour": 57, + "humans": 963391, + "timestamp": "2026-01-06T12:14:43.642602Z", + "zombies": 2156863 + }, + { + "hour": 58, + "humans": 0, + "timestamp": "2026-01-06T12:14:44.297738Z", + "zombies": 2652703 } ] \ No newline at end of file diff --git a/states_live.json b/states_live.json new file mode 100644 index 0000000..58b0823 --- /dev/null +++ b/states_live.json @@ -0,0 +1 @@ +[{"timestamp":"2026-01-06T12:28:29.675146Z","hour":0,"humans":10,"zombies":3}] \ No newline at end of file diff --git a/zombie_final.png b/zombie_final.png new file mode 100644 index 0000000..d46e553 Binary files /dev/null and b/zombie_final.png differ diff --git a/zombie_final.svg b/zombie_final.svg new file mode 100644 index 0000000..06f83f0 --- /dev/null +++ b/zombie_final.svg @@ -0,0 +1,4208 @@ + + + + + + + + + 0.0 + + + + + + + + + 9.71 + + + + + + + + + 19.43 + + + + + + + + + 29.14 + + + + + + + + + 38.86 + + + + + + + + + 48.57 + + + + + + + + + 58.29 + + + + + + + + + 68.0 + + + + + + + + + 0.0 + + + + + + + + + 2.5e6 + + + + + + + + + 5.0e6 + + + + + + + + + 7.5e6 + + + + + + + + + 1.0e7 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Heure + + + Population / Infection rate + + + Simulation Zombie Apocalypse + + + + + + + Humains + + + + + + + + Zombies + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file