Giter Club home page Giter Club logo

pyposim's Introduction

PyPoSim Build Status

A small power plant simulator that can ramp to a certain power level. Great for noisy time-series data generation!

TO-DO

[X] Provide Kafka support

[X] Ensure connection to Kafka Broker if Kafka is down on start-up

[X] Log datapoints into a file

[X] Provide REST API

[X] Add plants using UI

[X] Delete plants using UI

[X] Dispatch plants using UI

[X] Distinguish between capacity and setpoint

[X] Limit dispatch to be between zero and capacity

Getting started

  1. Clone the repo
  2. Navigate into the PyPoSim folder
  3. Install the required dependencies with pip install -r requirements.txt
  4. run it with python PyPoSim.py (standard port is 5000)

You can also run it using Docker, which is the preferred method.

Current set of parameters

  1. Capacity: The capacity of the plant
  2. Fluctuation: Corridor the output fluctuates within based on the capacity
  3. Ramp: Velocity to change from one power level to another

Play with the simulator

The simulator provides a REST API to create, poll, steere and delete simulated plants. For stream processing Kafka can be configured accordingly to push datapoints into a topic.

Add

Plants are added via the /add endpoint using the HTTP POST method. In order to function properly, the body must contain JSON in the following format:

{ "name": "Sample Plant", "internal_setpoint": 150, "fluctuation": 10, "ramp": 15 }

  • "name" is the name of your plant.
  • "capacity" is the power-level that this plant is able to generate at max. The output fluctuates around this value.
  • "fluctuation" is the fluctuation running around the power in percentage
  • "ramp" is the factor the plants ramps up and down per second in KW

A newly created plant always delivers the maximum power in the beginning.

The response of this endpoint contains a UID that is used to access the new created simulation.

Get current power

You can get the current power using /{UID}.

Get master data

You can get the master data using /masterdata/{UID}.

Dispatch

You can dispatch your plant (tell it to ramp to a certain powerlevel) by using the /dispatch/{UID}/{POINT} endpoint. Point is the new powerlevel your plant should ramp to. The plant ramps according to the ramp that was specified during creation.

Delete

To delete a simulator just use /delete/{UID}

MIT Licence

Copyright (c) 2016 Mark Keinhörster

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

pyposim's People

Contributors

crazzle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.