Giter Site home page Giter Site logo

garlicxd / base Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ftsrg-retelab/base

0.0 0.0 0.0 162 KB

Sample application for the Systems Engineering Laboratory. Do not clone this repository - use the fork provided by the lab instructors.

Java 100.00%

base's Introduction

Train Speed Controller

Overview

This is a sample application for the verification laboratory. Home edition. The laboratory must be finished before the 2nd of April

Getting started

  • The application is implemented in Java.
  • The project can be built using Gradle or Maven (currently Maven is preferred).
  • JUnit is used for tests.

Maven

Clone the repository and execute Maven to build the application:

mvn compile

To compile and run tests also execute:

mvn test

(That will be enough to know for the current exercises. If you are more interested, see this short guide about Maven.)

Gradle

Clone the repository and execute Gradle to build the application:

./gradlew build

To compile and run tests also execute:

./gradlew test

Overview

Structure

The application represents a simple train controller system with the following three components.

  • Sensor: The sensor can detect the change in the speed limit of the track and can signal in such cases to the controller.
  • Controller: The controller is responsible for controlling the reference speed of the train. The reference speed is set by the user, but the speed limit must also be kept.
  • User: The user can manipulate the reference speed of the train using a joystick.

Behavior

Setting the reference speed of the train works in the following way.

  • The user can set the position of a joystick, which can be zero or a positive/negative number.
  • In each time unit, the controller adds the position of the joystick to the current reference speed. Therefore the reference speed does not change if the position is zero, it is incremented if the position is positive and it is decremented if the position is negative.
  • After each change, the speed limit is checked and enforced.

The figure below illustrates this behavior using an example.

speed example

  1. First, the reference speed and the joystick is both at zero.
  2. At the first time unit, the joystick is set to a positive value, thus the reference speed is also incremented.
  3. As the joystick remains at a positive value, the reference speed is incremented again.
  4. However, it reaches the speed limit so in the next step it is not incremented even though the joystick still has a positive value.
  5. Later, the joystick is set to a negative position for one time unit, making the reference speed to decrease as well.

Future Features

There are no planned features.

base's People

Contributors

garlicxd avatar szarnyasg avatar davidhonfi avatar rorck avatar hajduakos avatar micskeiz avatar

base's Issues

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.