Giter VIP home page Giter VIP logo

transportscheduler's Introduction

Hi there ๐Ÿ‘‹

I am a researcher and software developer in the Software Engineering and Computing Systems (SECS) group, Department of ECE, Aarhus University. My personal website tells you more.

Collaboration ๐Ÿค

๐Ÿ”ญ Iโ€™m currently working on Digital Twin as a Service project. That is an excellent place to explore collaboration opportunity.

๐Ÿ‘จโ€๐Ÿ”ฌ These days I spend time researching and prototyping ideas on Digital Twins, Cyber Physical Systems and Distributed Computing for Manufacturing SMEs. You will find more details from my scientific publications.

๐Ÿคนโ€โ™‚๏ธ I'm always looking for interesting commercial problems to apply my professional expertise. I have been a technology consultant primarily for European companies for the past five years. This is an area of enduring interest to me.

Software Development Skills ๐Ÿ› ๏ธ

Area Languages, Tools and Developer Environments
DevOps and Cloud Docker Vagrant Azure Amazon AWS Ansible
Languages TypeScript JavaScript Python C++ C Java Bash R Elixir
Testing Jest Playwright Pytest GoogleTest JUnit Hamcrest bats
Code Quality Codecov Codeclimate ESLint CPPCheck shellcheck checkstyle pylint
Frameworks React React Material NodeJS JVM NetworkX Gephi
Documentation LaTeX MKDocs Swagger mediawiki Doxygen
Packaging npm pip waf maven

It would have nice to have one technology for each row, but life is complicated. ๐Ÿคทโ€โ™‚๏ธ

My Life ๐Ÿšถ

mindmap
  root((Me))
    Software
      digital Twin as a Service
      Networks
        IRCLogParser
        MLCAT
        BITS Darshini
        Transport Scheduler      
      AutolabJS
    Research
      Digital Twins
        Uses
            Software Engineering
            Distributed Systems
            Control Theory
        Projects
            DIGITbrain
            CPSENS
      Cyber Physical Systems
        Focus
            Industrial Manufactuers
        Projects
            HUBCAP
      Networks
        Graph Theory
        Measurements
            Protocol analysis
        Social Network Analysis
            IRC Channels
            Mailing Lists
    Teach
      BITS, Pilani
        Object Oriented Programming
          Java
        Internetworking Technologies
          Network Design
          Networks in Cloud
          Protocol Design
        Computer Networks
      RVRJC College of Engineering
        POSIX Programming
    Education
      BITS, Pilani
    Places
      Aarhus, Denmark
      India
        Goa
        Pilani
        Guntur
Loading

โšก I prefer programming over watching TV.

transportscheduler's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

transportscheduler's Issues

Query Completion at Network Constructor

Tests are:

  1. Query from one station to another station.
  2. Query from network constructor to a station.
  3. Answer from a station to network constructor.
  4. Query from network constructor to a station and answer coming back from another station.

code quality toolset

a linter and static code analysis tool for Elixir language. A web-based service that we can integrate with the github commits would be good as well.

Group itineraries at NC

When NC receives multiple potential itinerary results from destination, these must be collected and best option based on the given constraints must be chosen. In the future, batch queries are to be submitted to the application. The NC will then receive results from multiple destinations, and will need a separate collection of itineraries for each such query. Within each collection, NC will have selection and timeout mechanism separately.

Input parser

Input parser to load data from Stations.txt, Schedule.txt and Local_Variables.txt

Debug station crash

Periodically station process crashes. We are using supervisor to recover from a process crash. We don't know the reason for the crash itself. Use Elixir debugger to investigate the cause of crash.

API Call to Station Controller

API call to station controller fetches station schedule.

In order to complete this user story, an appropriate RESTful library must be integrated with station controller. A good way to check this would be to issue the API call from curl of the form http://localhost/schedule/stn_code and check all the output. We must receive all the schedule entries of a station in tuple form.

performance testing in travis

Joseph Kain wrote elixir-life project which has the exprof as a mix task. Please see Profile.ex for more details. He uses eflame to draw the performance graphs which will help in looking at the bottlenecks. For a way to include eflame as dependency, see his mix.exs file. An explanation of his code is available profile, profile-2.

As shown in the comments of profile-elixir-2 article, see RickHull's mix task for profiling.

Joseph Kain's bmark tool seems useful as well. An explanation of bmark tool is available.

benchee and benchfella helps benchmark unit tests. This is especially useful for integration kind of unit tests. We were hoping to get performance results at the level of functions of TransportScheduler. Both these tools help us get such performance numbers. Of the two tools, benchee seems more promising.

Ref: http://learningelixir.joekain.com/optimizing-elixir-posts/

docs for local installation

a wiki page detailing the installation setup required to make contributions to the project. The page would contain proper installation instructions for Erlang, OTP-19.0, Elixir and then the commands for running the ts app.

new station module

The new station module needs to be created with workex + gen_server + fsm. Obviously, the newly created station module must pass all the unit tests written so far.

tests for new station module

  • Stores given state
  • Retrieve the state
  • Update the given state
  • Receive a itinerary search query
  • Send completed search query to neighbours
  • Computes the itinerary correctly
  • Does not forward itineraries with potential self-loops
  • Does not forward stale queries
  • Incorrectly received queries are discarded
  • Terminated queries are handed over to query collector
  • Consumes rapid input stream of mixed queries
    • number of queries - 1000; 10,000; 1 million

memory consumption during query processing

Both sequential and concurrent queries increase the memory consumption of the application. Ideally after query is complete, the application must relinquish the excess memory. But, that does not happen.

Each sequential query increases the memory requirement till the entire available memory is allocated to ts application.

Auto inititialization of TransportScheduler

Presently an api call is needed to initialize the application. For auto initialization the code for initialization ( lines 24-33 in api.ex ) has to be moved to the init block of API.
But on doing so an api call is still required for initialization.

Process restart and registry update

In case a process abruptly terminates, NC must handle the issue. Only queries that pass through a non-existent process must be affected.
Process needs to be restarted and registry updated with new pid value. Any updates that had been made to local variables of the old process will be lost in such a situation.

API handle invalid queries

If an invalid query is submitted, say invalid station name that does not match any station code, NC will throw an exception. API module must handle these and reply with suitable message to user.

Support for concurrent itineraries at UQC

Concurrent requests need to be supported at UQC; each request gets its own timeout value of 0.5sec.

Choose proper data structure for storing query results. We want to send N (=10) itinerary results to the user.

Station module

A module representing one station. The detailed description of a station is available on wiki page.

update install scripts

The install scripts assume /home/ubuntu as the fixed parent directory of the project. Use git commands to deduce the project directory and make the scripts generic.

The updated scripts must run satisfactorily in direct host install scenario, in a virtual machine and in vagrant environment.

continuous builds

We can use Escript to continuously generate the bundled binary scripts to be run on BeamVM.
Once a Escript is successfully run manually, we can use Jenkins CI to build every commit.

Activeness of query in network into ETS

The NetworkConstructor module keeps track of the active queries (the queries whose results are awaited by the user and the itineraries are currently being searched in the network) in the form a Map data structure, and there is an abstracted client function check_active/2 that returns the status of a given query (true for active, false for inactive). This needs to be implemented in the ETS table at the UQC.

station.ex init block missing

initialization of station must happen in init function. At the moment, the work is being done in update() function.

Process Messaging overhead

At the moment, code profiling reveals that 70% of the processing time is spent in message passing. This is leading to a scenario of sequential query execution. If we can solve the problem of list storage in station processes and message passing overhead, truly concurrent query processing can take place.

Checkout the following resources.

  1. Edgelixir - elixir graph processing, similar to ours
  2. ETS vs Message Passing vs redis vs Mnesia (see references for links
  3. Learn from Pregel/Giraph - think like a vertex model. See review
  4. See Y-Combinator Question on this topic.
  5. Message passing benchmarks - thesis
  6. Erlang memory model
  7. message passing between processes - sending big lists, on choice of binary messages, message passing steps, ETS vs message passing, Erlang process documentation

search query response collection in a separate process

The itinerary search queries are all being collected in NC at the moment, making NC a bottleneck. We can change the scenario to the following.

  1. A query goes to NC
  2. NC spawns a query response collector process
  3. Adds the process id of the query response collector to the query structure.
  4. Gives the query to source station
  5. Destination passes the response to query response collector process
  6. Query response collector gives the set of responses to UQC

pre-release

It would be a good practice to have a ready release / pre-release for the software. That way, any foreseen issues on the dev branch would not effect the people who would want to use the software.

We can have a working commit that is decent, create a release out of it.

selection on mailbox messages

Erlang provides pattern matching on mailbox messages 1, 2. Even Elixir has the message receive pattern matching capability.

Also see an explanation on this stackoverflow answer.

We can probably use them to flush out the stale queries faster and to give priority to active queries at a station process.

Passing functions between elixir processes

A scalable way must be found for passing functions betweens elixir processes. Two possible approaches we are exploring are:

  1. Have a module of all possible functions and use Map to store references to functions in stations.
  2. Create a function in one process, quote the function and pass the function to another process. The receiving process unquotes the function and uses it.

move test files to correct location

The lib/maru/test.ex and test/ts_test.ex files are either not needed or in wrong location. They need to be either put in correct location or removed.

Input parser testing and integration

Input parser tests must pass and input parser module must integrate well with the station module. There would be unit tests for integration as well.

code profiling

we want a profiler that gives the execution time of each of our processes and the function calls. That way we can talk about optimization of the application in terms of domain logic.

The current tool exprof is giving the execution time results of low-level functions. We need to obtain profiling information on elixir processes.

select an appropriate profiling tool for this job.

Check for itinerary loops

When message passing is used for a given query, current implementation checks for all neighbours of a given station node. Hence, if an outgoing vehicle link exists back from a destination to a source node with valid time of departure, an itinerary may be generated that contains a loop. The same station is revisited and the resulting itinerary will never be the optimal one. Such a result must be excluded.

update dependencies to latest stable releases.

Suggested ones are:
Gen State Machine v2.0.0, Erlang OTP 20.0, Elixir v1.5

The problem is that the station.ex uses both synchronous and asynchronous functions of gen state machine. We need to convert all the synchronous functions to asynchronous before we attempt an upward revision of all the packages.

This issue would also solve #9.

wiki page on Erlang concurrency model

A short summary of Erlang concurrency model as used by Elixir. Also see the Actor concurrency model chapter in Seven Concurrency Models in Seven Weeks book.

Continuous Delivery Pipeline

We need to have all code commits regression tested and built. The necessary GitHub integrations must be setup.

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.