{"id":24380675,"url":"https://github.com/ophiase/emitter-optimizer","last_synced_at":"2026-04-24T06:33:27.861Z","repository":{"id":214393587,"uuid":"735330363","full_name":"Ophiase/Emitter-Optimizer","owner":"Ophiase","description":"An application featuring a parametric interface designed to optimize emitter positions 📡, catering to various emitter types specified by the user.","archived":false,"fork":false,"pushed_at":"2024-05-24T23:12:45.000Z","size":1489,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-27T16:03:00.235Z","etag":null,"topics":["emitter","optimization-algorithms"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ophiase.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}},"created_at":"2023-12-24T14:16:43.000Z","updated_at":"2025-11-19T12:57:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"6a749a04-a13b-4e5d-9878-ef5795083233","html_url":"https://github.com/Ophiase/Emitter-Optimizer","commit_stats":null,"previous_names":["ophiase/emitter-optimizer"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Ophiase/Emitter-Optimizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ophiase%2FEmitter-Optimizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ophiase%2FEmitter-Optimizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ophiase%2FEmitter-Optimizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ophiase%2FEmitter-Optimizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ophiase","download_url":"https://codeload.github.com/Ophiase/Emitter-Optimizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ophiase%2FEmitter-Optimizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32212807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T03:15:14.334Z","status":"ssl_error","status_checked_at":"2026-04-24T03:15:11.608Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["emitter","optimization-algorithms"],"created_at":"2025-01-19T08:27:44.306Z","updated_at":"2026-04-24T06:33:27.844Z","avatar_url":"https://github.com/Ophiase.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Emitter Optimizer 📡\nAn application with a parametric interface designed to optimize the positions of emitters. It caters to various emitter types specified by the user, including electromagnetic signals, water irrigation and optimal business placements – ensuring strategic positioning of stores to maximize customer coverage.\n\n## Table of Contents\n- Introduction\n    - [Model](#model)\n    - [Demo](#demo)\n- Functionality\n    - [Features](#features)\n- Setup\n    - [Installation](#installation)\n    - [Run](#run)\n- Future Development\n    - [Future Development](#future-development)\n\n## Introduction\n### Model\n---\n\nOptimizing signal coverage with emitters on a map involves maximizing a function $\\mathcal G$ over emitter positions $U$, defined as follows:\n\n- Emitter function $\\varphi : \\mathbb{R}^+ \\to \\mathbb{R}$ \n    - Takes the distance from the emitter as a parameter and returns the amount of signal perceived at this distance.\n- Sensor function $\\psi : \\mathbb{R} \\to \\mathbb{R}$\n    - Takes the sum of signals received at a given position and returns a score for the sensor.  \n- $U$: the positions of emitters.\n- Parameters $P := (E, \\mu, C)$\n    - $E$: A square map.\n    - $\\mu$: a density measure over $E$.\n    - $C$: a list of segments that block the signal.\n- $pass_C : (x, y) \\to 1 - \\prod_{s \\in C} (1 - \\mathbb{1}_{[x; y] \\cap s})$\n    - Returns 0 if the segment $[x; y]$ collides with a segment inside $C$, 1 otherwise.\n- $dist : (x, y) \\to || x - y ||_2$ \n- Received signal $r_{U, C} : x \\to \\sum_{y \\in U}\\varphi \\big( dist(x, y) \\big) \\cdot pass_C(x, y)$\n- Gain function $\\mathcal G_P : U \\to \\int_E \\psi \\circ r_{U, C}(x) \\, d\\mu(x)$\n\n\n### Demo\n---\nYou can try to optimize emitters using the following density map and colliders map.\n- ![](https://raw.githubusercontent.com/Ophiase/Emitter-Optimizer/main/resources/map/value_001.png) : ``resources/map/value_001.png``\n- ![](https://raw.githubusercontent.com/Ophiase/Emitter-Optimizer/main/resources/map/collide_001.png) : ``resources/map/collide_001.png``\n    - Image $\\to$ segments might make too much segments. \\\n    Use the approximation ``resources/map/collide_001.numpy``\n    - Note that solving wihout using colliders might be sufficient.\n\n- ### Adjust the parameters\n    - \u003cimg src=\"https://raw.githubusercontent.com/Ophiase/Emitter-Optimizer/main/resources/demo/interface_002.png\" width=500\u003e\n    - For instance, you can modify the sensor/emitter function\n        - \u003cimg src=\"https://raw.githubusercontent.com/Ophiase/Emitter-Optimizer/main/resources/demo/user_defined_sensor_screenshot.png\" width=300\u003e \u003cimg src=\"https://raw.githubusercontent.com/Ophiase/Emitter-Optimizer/main/resources/demo/user_defined_emitter_screenshot.png\" width=300\u003e\n- ### Update the parameters and start the solver\n    - Before solving : \u003c/br\u003e \u003cimg src=https://raw.githubusercontent.com/Ophiase/Emitter-Optimizer/main/resources/demo/render_000.png height=150\u003e \n    - After solving : \u003cbr\u003e \u003cimg src=https://raw.githubusercontent.com/Ophiase/Emitter-Optimizer/main/resources/demo/render_199.png height=150\u003e\u003cimg src=https://raw.githubusercontent.com/Ophiase/Emitter-Optimizer/main/resources/demo/loss.png height=150\u003e\n\n\n## Setup\n### Installation\n- conda install of the dependencies :\n```sh\nconda env create -f environment.yml\n```\n- automatic install of dependencies :\n```sh\n./install_dependencies\n```\n- manual install of the dependencies :\n```sh\npip install numpy tensorflow==2.14 dearpygui==1.10.0 opencv-python matplotlib\n```\n\n#### Technologies Used\n\n- **Dear PyGui:** Used to design and create the graphical user interface (GUI) for an intuitive and user-friendly application.\n\n- **TensorFlow:** Used to optimize the gain function using automatic gradient computation and gradient descent techniques.\n\n- **OpenCV (cv2):** Employed for computer vision tasks. Specifically, used to detect contour segments on the collision map.\n\n\n### Run\n```sh\n./run # first method\npython3 src/main.py # second method\nmake run # third method\n```\n\n## Features\n- Basic simulation : Gradient climbing of the gain function $\\mathcal G$\n\n- User defined emitter function $\\varphi$\n- User defined sensors activation function $\\psi$\n- User defined density map $\\mu$\n- User defined collision map $C$\n    - As a grayscale map (that will be converted to segment)\n    - As a numpy array of relatives positions.\n- Save emitters positions\n\n## Future Development\n- Features\n    - Optional optimizer (After multiples tests, we currently use Nadam by default)\n        - \u003cimg src=\"https://raw.githubusercontent.com/Ophiase/Emitter-Optimizer/main/resources/demo/optimizer.png\" width=300\u003e\n    - Finding the optimal number of sensors\n- Misc\n    - For a large number of emitters on a high-dimensional map, we can consider the following approximations of $\\mathcal G$.\n        - Almost every function used in the loss function can be approximated by a piecewise linear function $l$ on a relevant finite interval.\n            - $f \\approx l: x \\to \\sum_{J \\in I} (\\alpha_i x + \\beta_i) \\times \\mathbb{1}_J(x)$\n                - Where $I$ is a partition of $\\mathbb{R}^n$ such that every $J$ is a polytope.\n        - The Euclidean distance isn't a good candidate for piecewise linear function approximation, so it should be correctly approximated by Heron's method.\n        - This implies that the loss function can be approximated by the integral of a piecewise linear function, which can be very fast to calculate using parallelization.\n            - $||x, y||_2$ can be approximated using Heron's method.\n            - $\\varphi \\approx l_1$, a piecewise linear function.\n            - $\\psi \\approx l_2$, a piecewise linear function.\n            - $\\mu \\approx \\int l_3 \\, d\\lambda_2$, where $\\lambda_2$ is Lebesgue's measure over $\\mathbb{R}^2$.\n            - $\\mathcal{G}_P \\approx \\int_E l_1 \\circ (\\sum_y l_2(\\text{dist}(\\cdot, y)) \\times \\text{pass}_C(\\cdot, y)) \\, l_3 \\, d\\lambda_2$.\n    - Manifold distance.\n        - If the map $E$ is a chart over a manifold, we might want to use the distance over the manifold surface.\n        - Example :\n            - If we want to place emitters over Earth's continents. Our grid will be a chart  over the manifold $S^2$ and the distance will not be the euclidean distance.\n    - Use a \"compilation\" optimizer for Python.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fophiase%2Femitter-optimizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fophiase%2Femitter-optimizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fophiase%2Femitter-optimizer/lists"}