-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ofRandom #7598
ofRandom #7598
Conversation
Thanks @artificiel - this looks epic! I added a comment above. The main reason I wanted to preserve ofRandomize, was it might be more intuitive for someone searching for the function as they might start typing I'll let others chime in @ofZach @dimitre etc But overall excited to merge this. Thanks! |
Great! |
well, there the "real" example which is called i've implemented/tested on macOS and it works fine but i will not put up a fight — if there is a concensus i will rename it RandomExplorer -- but that |
@ofTheo wrote
ah good point, i tested here (macOS 13.4 / Xcode 14.3.1) and the autocomplete provided this: |
just clarifying I'm totally ok to keep as it is also. |
@ofTheo if you plan on including the distributions, for them to be readily available it should be included somewhere. the distributions depend on the engine and as i kept the things header-only, it must be included after ofRandomEngine. i guess the simplest way is to add a line in ofUtils.h, right after the inclusion of ofRandomEngine.h. or we keep it under the radar until the expurgation of srand/rand? |
Thanks!
I’m just trying to update the arm runner so it can pass those tests too. Hopefully today or tomorrow.
I’m happy either way in terms of the new features but would like to keep ofRandomize undeprecated.
|
…ppable containers, not just vectors)
…ette but unrelated to random)
OK, the #include now works for Engine and Distributions (but the distributions themselves are not used anywhere yet, except in the Random Explorer devapp). and deprecation removed on ofRandomize()! |
Thanks @artificiel - will merge this as soon as I get armv6 working |
@artificiel can you pull into your branch from master and see if the checks pass now? |
awesome! |
woohoo!! 🎉 |
as discussed in #7579 i've separated the engine from the distribution, and applied the minimum changes to the core to correctly integrate the engine, and fix the shuffle problem.
about deprecation warnings, i'd like to suggest now is the correct time to apply them to shuffle and seed (the implementation is at
of::random::shuffle
, but also allowsofShuffle
for the classic ofPattern). note that nowhere in the OF codebase (including examples)ofRandomize()
is being used, so it's not like warnings are going to pop everywhere (and the actual seeding process/naming is known to be confusing). also, the seeding has been parallelized so both the old and new get seeded (or reset) by the same seed calls.i created a new example,
randomExample
, that showcases the engine and the shuffling (and can be later expanded once thestd::
distributions are "revealed").to that effect, as of now the branch contains everything, but
ofRandomDistributions.h
isn't included/used anywhere by default. if you includeofRandomDistributions.h
in a project (like therandom explorer
devapp) it will compile and run. so it's ready to go — the next step is to change the old srand-based stuff to the new std::uniform stuff.if you'd rather not include the distributions yet, simply drop
utils/ofRandomDistributions.h
and therandom explorer
devapp.NOTE: the armv6 build still fails, and i think it cancels all the concurrent runs? i manually re-ran osx and it passes testing: https://github.com/artificiel/openFrameworks/actions/runs/5875297725