GithubHelp home page GithubHelp logo

Improving `RasterLayer` about mesa-geo HOT 4 CLOSED

wang-boyu avatar wang-boyu commented on September 25, 2024
Improving `RasterLayer`

from mesa-geo.

Comments (4)

rht avatar rht commented on September 25, 2024

I haven't been able to find a class name that encompasses those methods, while excluding

torus_adj
neighbor_iter
move_agent
place_agent
_place_agent
remove_agent
is_cell_empty
move_to_empty
find_empty
exists_empty_cells

What would be the consequence for RasterLayer to have those methods? Maybe the *_agent methods can be replaced with methods that raise NotImplementedError?

from mesa-geo.

wang-boyu avatar wang-boyu commented on September 25, 2024

The main difference between RasterLayer and Gridare:

  1. The GridContent in Grid is Cell in RasterLayer. This is fine since GridContent = Union[Agent, None] and Cell inherits Agent.
  2. In Grid there is self.grid: list[list[GridContent]] whereas in RasterLayer we have self.cells: list[list[Cell]]. This is a bit troublesome because self.grid is effectively renamed to self.cells.

Another issue is that we do not manipulate agents using RasterLayer directly. Instead, adding/updating/removing agents methods are defined at the GeoSpace level. It might be confusing if we have these methods also defined within RasterLayer and raise NotImplementedError.

I couldn't think of any easier ways to get necessary methods from Grid while avoiding the rest. Was hoping that changes wouldn't happen very often.

On the other hand, I don't want to alter the design of Mesa due to Mesa-Geo either.

from mesa-geo.

wang-boyu avatar wang-boyu commented on September 25, 2024

Mesa now has an experimental PropertyLayer and could be an alternative implementation for our RasterLayer: projectmesa/mesa#1898

from mesa-geo.

wang-boyu avatar wang-boyu commented on September 25, 2024

Replaced by #201. Closing this issue now.

from mesa-geo.

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.