Git Product home page Git Product logo

cutnfill_deeprl's Introduction

CutnFill_DeepRL

Positioning a building mass on topography while minimizing the necessary cut and fill excavation volume using actor critic methods.

Single Building Case

Multiple Building Case (10 building sequence)

Action space

The agent controls the building location through x, y coordinates, and the angle of rotation theta. This is done through a 3 dimensional discrete action space. The action space is transformed to a single dimensional large discrete action space as well. Training was performed on both representations of the action space.

import numpy as np
import torch

# 3-dim action space
param1_space = np.linspace(start=0.1, stop=0.9, num=17)
param2_space = np.linspace(start=0.1, stop=0.9, num=17)
param3_space = np.linspace(start=0, stop=160, num=17)

# 1-dim action space
action_space = np.array(np.meshgrid(param1_space, param2_space, param3_space)).T.reshape(-1,3)
action_space = torch.from_numpy(action_space)

print(f'action space size: {action_space.size()}')
print(action_space)

Reward function

The agent receives a penalty value equivalent to the cut and fill volume necessary to place the building at each step, plus a -5 penalty if the building mass intersects with any previously positioned buildings within the episode (not applicable to the single building case ofc). The reward signal is computed at each step in the Grasshopper environment according to the following code:

try:
    from ladybug_rhino.grasshopper import all_required_inputs
except ImportError as e:
    raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))

if all_required_inputs(ghenv.Component):
    reward = 0
    reward -= Soil_volume / 1000
    done = False

    bInter_relationList = [list(i) for i in bInter_relation.Branches]

    if len(bInter_relationList[0]) > 1:
        for i in bInter_relationList[0]:
            # building mass is inside some previously placed one
            if i == 0:
                reward -= 5
            # building mass intersects with some previously placed one
            elif i == 1:
                reward -= 5
        # compensate for self-intersection
        reward += 5

Terminal state condition

The terminal state is reached after 10 buildings are placed.

Acknowledgements

References

cutnfill_deeprl's People

Contributors

houssameehsain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.