Repository navigation
FL1d: a fleet's poses as a snapshot, its tick and bounds, and the gym's fleets - #1424
Merged
Merged
Conversation
…'s fleets WorldVehicles::poses(fleet): the fleet's placed vehicles as the last publish left them (fleet_poses: ids, chassis centres, headings, speeds, teams, their box and the tick), made each publish and swapped in whole with std::atomic_store, as sim_thread's snapshot is, so a view reads them from any thread without a lock and keeps the one it has unchanged. The summary gains .tick and .bounds. The gym's fleets: gym_options::fleets (pycvc's fleets=) names the document's fleets each reset lays out from their seed plus the reset's, their vehicles the agents after the options' own; a name the document does not declare is refused when the gym is made. WorldVehicles::starts keeps the entries spawn_starts was given since the last clear(), which the gym copies once. Docs: ARIADNE.md's Fleets and gym sections (and the gym's tick, 7/120 s at 120 Hz since OW1), the roadmap's FL1d row. Tests: AFleetsPosesAreASnapshot (a reader thread while the world steps), AriadneWorldGym.AFleetIsTheGymsAgents, test_pycvc_gym.py's fleets.
…ish a step AFleetsPosesAreASnapshot stepped 120 ticks in one batch, which publishes once at its end, then stopped the reader at once: on a loaded runner (ubuntu-22.04 Release) the reader had not run since and still held tick 1. Step one tick a batch, so 120 swaps happen under the reader, and wait (5 s at most) for it to take the newest before stopping it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FL1d of FLEETS_AND_NIGHT_ROADMAP.md, the last part of FL1, following FL1c (#1407).
poses(fleet): what a view draws a fleet fromWorldVehicles::poses(fleet)returns astd::shared_ptr<const fleet_poses>: the fleet's placed vehicles as the lastpublish()left them.std::atomic_store, the waysim_threadpublishes its own snapshot. A reader on any thread takes one withstd::atomic_loadand no lock, and keeps it as long as it likes, unchanged.clear()).publish_groupsalready reads per vehicle for its counts.The summary gains the two keys FL1a left for later:
.tick: the physics step the keys are of;.bounds:min_x,min_y,max_x,max_yof its placed vehicles.This is the read side that OW5's entity playout and FL2's entity layer take a fleet from.
The gym's fleets
gym_options::fleets(Python:fleets=["city"]) names the document's own fleets, itsstart:entries withfleet:.seed:plus the reset's seed. Each seed gets its own layout, and the same seed always gives the same one.agents, they are the only agents.strforfleets=, which would otherwise read as a list of letters.WorldVehicles::starts()keeps whatspawn_startswas given since the lastclear(), and the gym copies the fleets it names once, when it's made.Docs
poses,.tick,.bounds) and the gym's Fleets bullet.Tests
ariadne_scene_world_testpasses locally (MSVC, Jolt).AriadneWorldVehicles.AFleetsPosesAreASnapshot:entities()and the.tickand.boundskeys;poses()while the world steps 120 times, and every snapshot it sees is whole;clear()there is none.AriadneWorldGym.AFleetIsTheGymsAgents:test_pycvc_gym.pygainsfleets=and its refusals. I couldn't run pycvc on this box, so this runs first in CI'spycvc-linux.