Skip to content

Port of some of the python examples from the "Feeback Control for computer Systems" book to Java

License

Notifications You must be signed in to change notification settings

Petikoch/feedback_control_bookexamples_in_java

Repository files navigation

Feedback Control Bookexamples in Java

Apache License 2 Build Status

Introduction

This github project contains a port of the examples from the book Feeback Control for computer Systems from Philipp K. Janert to the Java language.

In the book the examples are in Python, here they are in Java 8.

book

You will not find much explanation here about the examples, I assume you read the book yourself and want to try the examples yourself on the JVM. The book is written well and compact, so it’s worth reading it anyway.

Personally, I think that the feedback control topic is very promising for a lot of problems in computer systems today and I assume, most of the software engineers don’t know about it, although they use feedback control everyday without even noticing it (toilet flush? car cruise control? room temperature control? …​). At least for me this was true since 2015.

The examples are all about feedback control simulation. If you are looking for some kind of "library to use" in a real application, check out https://github.com/Petikoch/feedbackcontrol4j.

How to run the examples

Via gradle (wrapper)

Clone the git repo to your local machine, cd to the created dir and execute

> ./gradlew run

This will build the project, download all dependencies and startup the slightly modified groovy console. Run the code with the "Execute Groovy Script" Button in the toolbar. Open the examples via the "Open Groovy Script" Button in the toolbar (and yes, select one of the java-Files).

run standalone

Via IDE

Clone the repo directly and import it into your favourite IDE (IntelliJ, Eclipse, …​).

Afterwards you can run the examples directly from the IDE (start e.g. with Ch13_cache_closedloop_jumps.java).

run in ide

Requirements

Java 8

Support

Please use GitHub issues and pull requests for support.

Motivation

Since I wasn’t familiar with python and I usually work on the JVM with Java 7 or 8 and Groovy, I thought it would be nice to have the code in a for me more familiar language. Also by porting it, I became more familiar with the examples and to a deeper understanding of the topic.

The additional written unit-tests in this project might help you too, to better understand the "things".

I also thought it would be nice to be able to change the code and see the resulting chart in the same "environment" with one tool. Therefor the groovy console with the JFreeChart integration.

And last but not least, I think I’ll do some more work in this field, thinking of experimenting instead of "just" simulating with e.g. a dynamic sized thread-pool which adjusts the number of threads depending on the CPU load. With real threads, real runnables, etc…​ For this, a lot of the code from this github repo comes handy.

Best regards,

Signature

About

Port of some of the python examples from the "Feeback Control for computer Systems" book to Java

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published