How to use the aiomas.expose function in aiomas

To help you get started, we’ve selected a few aiomas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github frnsys / system_designer / syd / node / node.py View on Github external
    @aiomas.expose
    def bulk_get(self, ids, var):
        return self.container.bulk_get_local(ids, var)
github frnsys / system_designer / syd / world / voxel.py View on Github external
    @aiomas.expose
    def neighbors(self, position):
        """returns the neighbors around the position,
        i.e. the values of the surrounding cells"""
        x, y, z = position
        if self.wraps:
            return np.pad(self.state.grid, 1, mode='wrap')[
                max(0, x):x+3,
                max(0, y):y+3,
                max(0, z):z+3].ravel()[self._wrap_mask]
        else:
            xs = [x]
            ys = [y]
            zs = [z]
            if x > 0:
                xs.append(x-1)
            if x < self.width-1:
github frnsys / system_designer / syd / world / grid.py View on Github external
    @aiomas.expose
    def neighbors(self, position):
        """returns the neighbors around the position,
        i.e. the values of the surrounding cells"""
        x, y = position
        if self.wraps:
            return np.pad(self.state.grid, 1, mode='wrap')[
                max(0, x):x+3,
                max(0, y):y+3].ravel()[self._wrap_mask]
        else:
            xs = [x]
            ys = [y]
            if x > 0:
                xs.append(x-1)
            if x < self.width-1:
                xs.append(x+1)
            if y > 0:
github frnsys / system_designer / syd / node / node.py View on Github external
    @aiomas.expose
    def states(self):
        """iterator over every agent state in the node"""
        return self.container.states()
github frnsys / system_designer / syd / node / node.py View on Github external
    @aiomas.expose
    async def setup_agents(self, *args, **kwargs):
        """call the 'setup' method on all agents"""
        self.container.logger.debug('setting up agents! in manager')
        await self.container.setup_agents(*args, **kwargs)
github frnsys / system_designer / syd / agent / base.py View on Github external
    @aiomas.expose
    def submit_var_update(self, var, value):
        """convenience method for updating a single state variable"""
        self.submit_update(update_var, var, value)
github frnsys / system_designer / syd / agent / base.py View on Github external
    @aiomas.expose
    def get_state(self):
        """get the agent's state"""
        return self.state
github frnsys / system_designer / syd / world / grid.py View on Github external
    @aiomas.expose
    def set_position(self, value, position):
        """set the value of a position in the grid.
        this can be, for example, an agent address."""
        x, y = position
        self.state.grid[x, y] = value
github frnsys / system_designer / syd / node / node.py View on Github external
    @aiomas.expose
    def update_agents(self, *args, **kwargs):
        """call the 'update' method on all agents"""
        self.container.update_agents(*args, **kwargs)
github frnsys / system_designer / syd / world / grid.py View on Github external
    @aiomas.expose
    def vacancies(self, empty_val=0):
        return np.vstack(np.where(self.state.grid == empty_val)).T

aiomas

Asyncio-based, layered networking library providing request-reply channels, RPC, and multi-agent systems.

MIT
Latest version published 7 years ago

Package Health Score

42 / 100
Full package analysis