{"id":21063984,"url":"https://github.com/davidenunes/param-sweeper","last_synced_at":"2026-05-17T21:33:15.551Z","repository":{"id":7121255,"uuid":"8415797","full_name":"davidenunes/param-sweeper","owner":"davidenunes","description":"A Parameter Sweeping Utility Library","archived":false,"fork":false,"pushed_at":"2017-12-03T20:13:54.000Z","size":270,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-14T01:24:41.611Z","etag":null,"topics":["combinations","java","parameter","parameter-sweep","sweeper"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidenunes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-25T18:57:05.000Z","updated_at":"2017-10-03T09:15:43.000Z","dependencies_parsed_at":"2022-08-27T17:11:21.012Z","dependency_job_id":null,"html_url":"https://github.com/davidenunes/param-sweeper","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/davidenunes/param-sweeper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidenunes%2Fparam-sweeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidenunes%2Fparam-sweeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidenunes%2Fparam-sweeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidenunes%2Fparam-sweeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidenunes","download_url":"https://codeload.github.com/davidenunes/param-sweeper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidenunes%2Fparam-sweeper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33155665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"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":["combinations","java","parameter","parameter-sweep","sweeper"],"created_at":"2024-11-19T17:47:54.500Z","updated_at":"2026-05-17T21:33:15.537Z","avatar_url":"https://github.com/davidenunes.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Param Sweeper\n=============\n\nA Parameter Sweeping Utility Library. This library is intended to easily create parameter sweeps for simulation models in Java. \nThe task of sweeping parameter spaces is rather trivial but can lead to code cluttered with the creation of multiple parameter value ranges and\nugly nested cycles to create possible parameter combinations. This library provides the utilities to easily create parameter sweeps of various types\nand combine them into combined parameter sweeps. Both parameter sweeps and the combined parameter sweeps are easily iterable and supply configuration instances on demand.\n\nThis library uses the [Java Configuration API](http://commons.apache.org/proper/commons-configuration/) from apache commons to \ncreate simple key-value structures ([`Configuration` objects](http://commons.apache.org/proper/commons-configuration/apidocs/index.html))\nthat can be used to configure simulation model (or whathever you want to configure).\n\n## Simple Library Usage\nYou can use the `ParameterSweepUtil` to create multiple parameter sweeps in the following manner:\n\n```java\n//create an integer sequence from 0 to 10 with steps of 1\nParameterSweep sweepSequence1 = ParameterSweepUtil.createSweep(\"p1\", 0, 10, 1);\n\n//create a sequence of double values from 0 to 10 with steps of 0.5\nParameterSweep sweepSequence2 = ParameterSweepUtil.createSweep(\"p2\", 0.0, 10.0, 0.5);\n\n//create a parameter sweep with only one value\nParameterSweep sweepSingleValue1 = ParameterSweepUtil.createSweep(\"p3\", 1);\n\nParameterSweep sweepSingleValue2 = ParameterSweepUtil.createSweep(\"p4\", 1.0);\n\nParameterSweep sweepSingleValue3 = ParameterSweepUtil.createSweep(\"p5\", \"jabbas\");\n\n//create a parameter sweep with a pre-existing value list\nList\u003cInteger\u003e values = new ArrayList\u003c\u003e();\nvalues.add(1);\nvalues.add(5);\nvalues.add(10);\n\nParameterSweep sweepList = ParameterSweepUtil.\u003cInteger\u003ecreateSweep(\"p6\", values);\n\n//create a CombinedParameterSweep\nList\u003cParameterSweep\u003e sweeps = new LinkedList\u003c\u003e();\n\nsweeps.add(sweepSequence1);\nsweeps.add(sweepSequence2);\nsweeps.add(sweepSingleValue3);\nsweeps.add(sweepList);\n\n//2 in this case is the number of runs for each parameter combination\n//the CombinedParameterSweep Iterator will present each configuration twice\nCombinedParameterSweep paramSpace = ParameterSweepUtil.createCombinedSweep(sweeps,2);\n\n//iterate over possible configurations\nfor (Configuration config : paramSpace) {\n  //do stuff with the values in the configuration for example\n  int v1 = config.getInt(\"p1\");\n  int v2 = config.getInt(\"p2\");\n  String v3 = config.getString(\"p5\");\n  //... etc\n}\n\n\n```\n## Loading Parameter Spaces from Files\nTo make this library more flexible when used with other packages. We added a `ParameterSweep` loader. This can be used either by \ncreating a `SweepLoader` instance and using the appropriate method to load the parameters or by using the `ParameterSweepUtil` to \nload sweeps from a file or create `CombinedParameterSweep` objects directly using that file.\n\n```java\n//loading a list of Parameter Seeps from a file\n\nSweepLoader sweepLoader = new SweepLoader();\nList\u003cParameterSweep\u003e sweeps = sweepLoader.fromFile(file);\n\n//creating a combined sweep using the parameter sweep utility\nint runs = 30;\n\nCombinedParameterSweep combinedSweep = ParameterSweepUtil.loadCombinedSweep(file, runs);\n\n\n```\n\nA typical parameter sweep file looks like this:\n\n```\n# Parameter Sweep File\n\n# Parameters \nparams.0.name = p1-single\nparams.0.sweep = single\nparams.0.type = int\nparams.0.value = 15\n\nparams.1.name = p2-list\nparams.1.sweep = list\nparams.1.type = int\nparams.1.value = 1,2,3,4,5,6,7,8,9,10\n\nparams.2.name = p3-sequence\nparams.2.sweep = sequence\nparams.2.type = double\nparams.2.value.from = 0.0\nparams.2.value.to = 10.0\nparams.2.value.step = 0.5\n```\n\nFor each parameter, you must provide:\n\n* string that identifies uniquely the parameter as its `name`;\n* a `type of sweep` which can be `single`, `list` or `sequence`;\n* a `data type` which determines the type of the values: this can be `int`, `double`, `string`, or `boolean`;\n* a `value` which can be a single vale a list of values or a sequence defined using the `from`, `to` to define the range of the sequence and the `step` which defines the intermediate values of the sequence;\n\n\n## Dependencies\n* commons-configuration-1.9\n  * commons-logging-1.1.1\n  * commons-lang-2.6\n* commons-collections-3.2.1\n\n\n## Licence\n Param Sweeper Library\n \n * Copyright (C) 2013 Davide Nunes \n * Authors : Davide Nunes - davidelnunes@gmail.com\n \n The param-sweeper library is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n \n The param-sweeper library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n \n You should have received a copy of the GNU General Public License\n along with the b-have sweeper library.  \n If not, see [GPL 3.0](http://www.gnu.org/licenses/gpl.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidenunes%2Fparam-sweeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidenunes%2Fparam-sweeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidenunes%2Fparam-sweeper/lists"}