Skip to content

Clockworks distributed simulation app for android devices

Notifications You must be signed in to change notification settings

arntanguy/clockworksDSA

 
 

Repository files navigation

ClockworksDSA

Clockworks distributed simulation app for android devices

Contents

#Server

User Environment Listener

  • Listen for environments from users over HTTPS, authentication is optional
  • Get number of recent devices from Ping Queue.
  • Get space in Code Queue.
  • Split code based on number of available devices, (i.e. split amout is minimum of: pings received in the previous allowed window, space in queue and how much the code can be split) and add to code queue
  • Respond to users with rejects/acknowledgements

Database accesses:

  • User authentication

Shared variable accesses:

Top

SNUIL

User Result Assembly

Database accesses:

  • User authentication
  • Results: read/purge

Top

SNURAL

Bot Interface Listener

Database accesses:

  • Result logging: write

Shared variable accesses:

Top

Timer / Timeout handlers

  • One for each process of the simulation

Shared variable accesses:

Top

SNAIL

Database Schema

Authentication

Sample Sample Sample
### Environment
Sample Sample Sample
### Process
Sample Sample Sample

Top

Bot

Bot Network Interface

Top

Android Network Interface

API Spec

WOP Ping (Waiting On Process)

  • Sent from the user after every t seconds to check if the results have been collected
GET /resultassemblyhandler HTTP/1.1
Host: www.example.com
Content-Type: text/plain-text; charset=utf-8
Content-Length: length
Environment-Id: 0

WOP Ping Response:

  • 102: Process Not ready
Sample
  • 200: Results
Sample
  • 401: Authentication failure
Sample
  • 404: Process not found
Sample

Top

RTP Ping (Ready To Process)

  • Contains results from a previously sent process if such a process exists
  • Expects response of a new process
GET /botrequesthandler HTTP/1.1
Host: www.example.com
Content-Type: text/plain-text; charset=utf-8
Content-Length: length
Environment-Id: 0
Segment-Id: 0
May contain traces of results

RTP Ping Response:

  • 200: Response with code to run
Sample Response of this type here
  • 204: No code available at this time from Queue
Sample Response of this type here

Top

RTO Ping (Reset Time Out)

  • Tell the server to reset its process timer for the indicated process
POST /botrequesthandler HTTP/1.1
Host: www.example.com
Content-Type: text/plain-text; charset=utf-8
Content-Length: length
Environment-Id: 0
Segment-Id: 0

RTO Ping Response:

  • 200: Success
Sample
  • 404: Process Not Found
Sample

Top

Environment

Environment Response:

Top

#Appendix

Flowchart Key

  • Yellow: Start
  • Green: Data received
  • Red: Response sent
  • Blue: Database access
  • Black: Scary Stuff

Top

Ping Queue

  • On read:
  • Pop expired pings of the top of the Queue and update size, then read size
  • On write:
  • Simply add ping log to the Queue

Top

Code Queue

  • Standard Queue of code objects that allows the threads to operate concurrently

Top

About

Clockworks distributed simulation app for android devices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 93.0%
  • Python 5.8%
  • Shell 1.2%