Giter Site home page Giter Site logo

pandapowerfp's Introduction

EBPP

EBPP (Electric Blocks PandaPower) is a server that sends and receives simulation results for the mod Electric Blocks.

Contributors Forks Stargazers Issues License

Table of Contents

About The Project

EBPP is a python HTTP server written using flask that receives power flow simulation requests, performs the simulation, and returns the results. We use pandapower to perform the simulations. This software is written specifically for use with the Electric Blocks mod, but could theoretically be used to call pandapower for other applications. The simulation software is decoupled from the actual server mod itself to allow for a single server to process simulations for multiple minecraft servers. EBPP does not track the state of the Minecraft world and so all calls are stateless. This means the Electric Blocks mod is responsible for tracking the state of blocks in the game. The mod must track connectivity, block state, and update events. It will then make requests to the server when needed. All Electric Blocks (except wires/lines) must be assigned a UUID. This allows EBPP to return the information results for each block in game.

Built With

Installation

When installing this software you have two options. The first option uses docker to automate the process. This option is easier to do, but requires that you have docker. The second option is the manual installation.

Docker Install

First make sure you have docker installed on your computer/server. Then build with this command:

docker build github.com/ElectricBlocks/ebpp -t ebpp

Once the docker image is finished building, you can run with the command:

docker run -d -p 1127:1127 ebpp

Manual Install

To install manually, make sure you have python3 installed and then run the following commands:

git clone https://github.com/ElectricBlocks/ebpp.git
cd ebpp
pip install -r requirements.txt

Once the python packages are installed, you can run with the command:

python ebpp.py

Usage

Once the server is running, you can test it by going to http://127.0.0.1:1127 in your web browser. Make sure you are not using SSL. You should receive a simple text welcome response.

The endpoint for using the API is http://127.0.0.1:1127/api. This API sends and receives info using JSON. All packets must include a status key that contains the request type.

Client Requests

KEEP_ALIVE checks if the server is responding to requests.

{
    "status": "KEEP_ALIVE"
}

SIM_REQUEST requests that server perform a simulation. Properties for each element will depend on the type. EBPP does not do error checking and will just pass these values onto PandaPower.

{
    "status": "SIM_REQUEST",
    "3phase": false,
    "elements": {
        "UUID": {
            "etype": "gen",
            "bus": "UUID of Bus",
            "p_mw": 1.0,
            "vm_pu": 120,
            "other_properties": "value",
            ...
        },
        ...
    }
}

Server Responses

KEEP_ALIVE lets client know that serer is responding to requests.

{
    "status": "KEEP_ALIVE",
    "response": "Keep alive request acknowledged"
}

SIM_RESULT results of the sim request. Results for each element will depend on type.

{
    "status": "SIM_RESULT",
    "elements": {
        "UUID": {
            "etype": "gen",
            "p_mw": 1.0,
            "vm_pu": 120.0,
            "other_results": "value",
            ...
        },
        ...
    }
}

JSON_ERROR clients request could not be parsed as json.

{
    "status": "JSON_ERROR",
    "response": "Some Error Message"
}

INVALID_ERROR clients request was able to be parsed, but an invalid status was given or there is some other issue with the request.

{
    "status": "INVALID_ERROR",
    "response": "Some Error Message"
}

PP_ERROR client's SIM_REQUEST was accepted by EBPP, but PandaPower returned an error.

{
    "status": "PP_ERROR",
    "response": "Some Error Message"
}

CONV_ERROR client's SIM_REQUEST was accepted by EBPP, but the PandaPower failed to converge on a stable result. The network is invalid or unstable.

{
    "status": "CONV_ERROR",
    "response": "Some Error Message"
}

This software is in heavy development. This will probably change and break. Sorry ¯\_(ツ)_/¯.

License

Distributed under the GNU Affero General Public License. See LICENSE.md for more information.

Acknowledgements

This software is developed by students at the University of Idaho for the Capstone Design class:

  • Zachary Sugano - Project Lead - zachoooo
  • Christian Whitfield - Team Member/Communications Lead - oceanwhit

pandaPowerFP

pandapowerfp's People

Contributors

batrdos 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.