Git Product home page Git Product logo

double-cube-jump-and-stay-multilingual's People

Contributors

sassbalint avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

double-cube-jump-and-stay-multilingual's Issues

Incorrect inequality in the output 0 > 1.7

In commit 5dde1d7 line 293 in impl.py the else statement explicitly sets 0:

ratio( act, max_out ) if max_out else 0, STAY ) )

but it later shows on the output as 0 > 1.7 which is obviously incorrect.

I suggest using float('inf') instead which produces the same result, but mathematically correct output generated.

Unreasonable two variable swaps

In commit 5dde1d7 impl.py has two strange, unreasonable variable swaps which probably due to a bug:

Line 121:

build_dc_recursively( d, fq, dvfq, dvl, de, deb )

de and deb are swaped compared to the definition of the function in line 146:

def build_dc_recursively( d, fq, vertices_f, vertices_l, edges_back, edges_fwrd ):

This order is kept for the recursion in line 84:

        build_dc_recursively( e, fq, vertices_f, vertices_l, edges_back, edges_fwrd )

But outside of the function there is two another strange swap that fix the first one:

Line 135:

  # transfer edges of the given ss into main 'cl_edges_back'
  for i in de:
    for j in de[i]:
      if i not in cl_edges_back:
        cl_edges_back[i] = {}
      cl_edges_back[i][j] = 1

Notice de which is used for cl_edges_back probably mistaken in favour of deb. In conjunction with

Line 141:

  # transfer edges of the given ss into main 'cl_edges_fwrd'
  for i in deb:
    for j in deb[i]:
      if i not in cl_edges_fwrd:
        cl_edges_fwrd[i] = {}
      cl_edges_fwrd[i][j] = 1

Notice deb which is used for cl_edges_bwrd probably mistaken in favour of de.

Correcting all these mistakes result the same output, but a more reasonable code.

BTW it is not recommended to use too short variable names in Python.

Probable bug around the pVCC finding part

In commit 5dde1d7 the file impl.py line 279 seems a bit messed up:

      # is there a stay?
      max_out = None
      d = cl_edges_fwrd.get( act, {} ) # forward vertices
                                       # there are always one except at a ss

      if d:
        max_out = max(d.keys(), key=lambda x: (cl_vertices_f[x],x))

      if max_out and is_stay( act, max_out ):

The cl_edges_fwrd.get( act, {} ) part is strange as it allows full sentences to be pVCC-s in contrary to the comment. Is it intended? Please make it more explicit!

max() has a default argument when empty iterator is given, so the code could be simplified.

Could you please add more comment for the ratio computing code?

In commit 5dde1d7 the file impl.py there is two different ratio computation for JUMP and for STAY. It would be nice to have some reference eg. to the paper why they have to differ.

Line 176:

ratio = fq/cl_vertices_f[j]

And Line 191:

ratio = cl_vertices_f[j]/fq

I suspect the forward and backward edge differences, but without any pointer to the paper I could not find any information.

BTW the two code parts could be refactored as it has only minor differences like this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.