[
https://issues.apache.org/jira/browse/TINKERPOP-2014?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16858836#comment-16858836
]
stephen mallette commented on TINKERPOP-2014:
---------------------------------------------
starting to wonder if there is a use case for this outside of testing. if you
wanted a deterministic result, you likely wouldn't be using stuff like
{{sample()}} or {{coin}}. if it's just for testing, then is there really a need
for explicit API changes or additions? maybe we just provide an environment
variable that allows setting of the seed. That approach also works nicely for
an enum like {{shuffle}} which doesn't have knowledge of the traversal in the
first place to get a seed value if it were even available on the configuration.
an environment variable would be a much less intrusive change and could
implemented all the way back to to {{tp33}}.
> Allow an ability to specify seeding for random methods such as coin, sample
> and Order.shuffle
> ---------------------------------------------------------------------------------------------
>
> Key: TINKERPOP-2014
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2014
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.3.3
> Reporter: Sam Rosen
> Priority: Minor
>
> Currently, all the methods that have non-deterministic behavior such as coin
> and sample have no ability to set a seed. The ability to set a seed will
> allow for reproducible and testable behavior as well as more control flow for
> random processes. If a certain backend does not support seeding, they could
> simply ignore it. Some possible API changes:
> graph.traversal.V().withSeed(2L).coin(.5)
> graph.traversal.V().sample(3, 0L)
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)