Coder Social home page Coder Social logo

smart-grid's Introduction

Smart Grid

How to Compile

Create a new folder named obj when compile the program for first time.

make

We used clang++ to compile our program, however, you can change it in the Makefile as you wish. Since our program utilized some features of c++11, the compiler must support c++11 to compile the program.

Usage

To run this program, execute the command below in root folder of the project.

./smart_grid inputs/equipments.data inputs/nodes.pos inputs/grids.wrapper

Structure of Program

This picture demostrates the structure of our program. Detailed explanation of the picture is in the blockquote below.

The filled arrow represents the ownership between classes, from owner to the class owned by the owner. Owning a class means that it's responsible for managing the life cycles of its objects. The hollow arrow represents the inheritance between classes, from child to parent.

The idea of this design is to seperate the fixed information from the data that we may need to change. All equipments in the smart grid is like a database storing all the static informations, and we query it only when we need to.

To achieve this, we abstract the vertices and edges from what it really is by defining a pointer pointing to its corresponding equipment instead of storing all the equipment's informations in it, causing unnecessary copys. For example, a vertex which is actually a resident will contain a pointer pointing to its corresponding resident object instead of making its own copy of the equipment's informations.

The beauty of this design is that when we have mutiple instances of a equipment, we can construct different vertices/edges referecing exactly the same equipment without the need to copy all the repetitive informations.

Some Useful Tools

Drawing the Graph

I wrote a web app on JS Bin to draw graphs of grids. To draw using this tool, just upload the file outputs/graph.json and the result will show up instantly.

The file outputs/graph.json is generated by the function Graph::OutputJSON() using a third party library.

Easier Code Navigation

To make navigating codes more efficiently, we use ctags to generate the tag file. Use Vim or some other editors supporting ctags to utilize the power of it.

smart-grid's People

Contributors

harry830622 avatar prettyfat avatar

Watchers

James Cloos avatar  avatar  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.