You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Marko A. Rodriguez (JIRA)" <ji...@apache.org> on 2015/09/02 00:02:46 UTC

[jira] [Created] (TINKERPOP3-826) OneToManyBarrierStrategy

Marko A. Rodriguez created TINKERPOP3-826:
---------------------------------------------

             Summary: OneToManyBarrierStrategy
                 Key: TINKERPOP3-826
                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-826
             Project: TinkerPop 3
          Issue Type: Improvement
          Components: process
            Reporter: Marko A. Rodriguez
            Assignee: Marko A. Rodriguez
             Fix For: 3.1.0-incubating


Currently, for doing energy diffusions with Gremlin sacks, you do this:

{code}
gremlin> g.withSack(1.0).V(1).local(out('knows').barrier(normSack)).sack()
==>0.5
==>0.5
{code}

Why are we doing this? Because {{out('knows')}} is one-to-many and thus, after we split the traversers, we need to renormalize their sacks so you always have a constant total energy (i.e. 1.0).

However, starts to look ugly if the traversal is complex. Perhaps we have {{OneToManyBarrierStrategy}} that can be activated which simply wraps all {{flatMaps}} into a {{local(....barrier(consumer))}}. If that strategy is activated, then the above diffusion would look like this:

{code}
gremlin> g.withSack(1.0).V(1).out('knows').sack()
==>0.5
==>0.5
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)