moptipyapps.spoc package¶
Tools for the ESA SPOC challenges.
The European Space Agency (ESA) regularly holds its Space Optimisation Competition (SpOC), e.g., at the Genetic and Evolutionary Computation Conference (GECCO, see, e.g. <https://gecco-2026.sigevo.org/Competitions>).
The website of the challenge is <https://optimise.esa.int>. Here we provide tools for this challenge.
All data contained in here is taken from <https://github.com/esa/SpOC4>, which is also under the GPL-3 License. The copyright belongs to the authors of this data. Create submission data for the SPOC challenge. Bases: A space that also provides the submission data. This space is designed to wrap around an existing space type and to generate the SPOC submission text when textifying space elements. Log the parameters to a logger. logger ( Create a submission file text. This function follows the specification given in <https://api.optimize.esa.int/data/tools/submission_helper.py>, with the exception that it tries to convert floating points to integers, where possible without loss of precision.Subpackages¶
Submodules¶
moptipyapps.spoc.submission module¶
>>> from moptipy.spaces.permutations import Permutations
>>> perms = Permutations((0, 1, 2, 3))
>>> submit = SubmissionSpace(perms, "The Challenge", "The Problem")
>>> submit.initialize()
>>> the_x = submit.create()
>>> the_x[:] = perms.blueprint[:]
>>> the_str = submit.to_str(the_x)
>>> print(the_str)
0;1;2;3
----------- SUBMISSION -----------
[
{
"challenge": "The Challenge",
"problem": "The Problem",
"decisionVector": [
0,
1,
2,
3
]
}
]
>>> the_x2 = submit.from_str(the_str)
>>> submit.is_equal(the_x, the_x2)
True
SpaceKeyValueLogSection) – the logger>>> print(to_submission("a", "b", (1, 2, 3)))
[
{
"challenge": "a",
"problem": "b",
"decisionVector": [
1,
2,
3
]
}
]
>>> print(to_submission("a", "b", np.array(((1, 2, 3), (0.2, 4, 4.3)))))
[
{
"challenge": "a",
"problem": "b",
"decisionVector": [
[
1,
2,
3
],
[
0.2,
4,
4.3
]
]
}
]