Giter Club home page Giter Club logo

Comments (5)

prettymuchbryce avatar prettymuchbryce commented on May 21, 2024

Hey kkoch. Thanks for the issue.

Do you think your problem could be solved with only one new method setAcceptableThreshold ?

Why might an explicit setWeightedGrid function be necessary ?

from easystarjs.

kkoch986 avatar kkoch986 commented on May 21, 2024

The purpose of setWeightedGrid would be to assign costs to each tile based on its value. If i ran something like this:

var easystar = new EasyStar.js();
easystar.setGrid(this.map);
easystar.setAcceptableTiles([true]);
easystar.enableDiagonals();

Even if the values in map are numeric it wouldnt call easystar.setTileCost(tileType, multiplicativeCost); for each number in there would it? My thought is having a setWeightedGrid function that assigns the cost to each tile according to its number and maybe flag it as a weighted cell so it could react to changes in the values.

I havent really looked into the source too much yet so I'm not sure exactly what would have to be done to accomplish this.

from easystarjs.

kkoch986 avatar kkoch986 commented on May 21, 2024

Thinking about it more, it wouldnt have to actually set the tile cost but maybe flag it as numerically weighted and when we look at the tile to get the cost we could just return the value

from easystarjs.

prettymuchbryce avatar prettymuchbryce commented on May 21, 2024

I understand now. You want to use setWeightedGrid as a way to batch-set tile costs, or even possibly create a second data structure to store these weighted values separately from the associated values from setGrid.

After thinking about it some more, I think this use case is pretty specific to your own needs. Something like this makes more sense to me as functionality that sits compositionally outside of EasyStar itself. You could keep track of these impassable tiles separately in your own code, and make them impassable with EasyStar by using the API calls setAcceptableTiles() or avoidAdditionalPoint().

from easystarjs.

kkoch986 avatar kkoch986 commented on May 21, 2024

no problem, thanks!

from easystarjs.

Related Issues (20)

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.