Skip to content

soniloi/clockworksDSA

 
 

Repository files navigation

ClockworksDSA

Clockworks distributed simulation app for android devices

Contents

#Server

User Environment Listener

Shared variable accesses:

Top

SNUIL

User Result Assembly

Top

SNURAL

Bot Interface Listener

Shared variable accesses:

Top

Timer / Timeout handlers

  • One process for each segment of the simulation environments

Shared variable accesses:

  • Code Queue: Re-add segment to Queue if time out interval reached

Top

SNAIL

Bot

Bot Network Interface

  • Ping server to indicate readiness to process
  • Process python script

Top

Android Network Interface

API Spec

WOP Ping (Waiting On Process)

  • Sent from the user after every t seconds to check whether all results have been collated
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
 
  • 200: Results
[
	{
		"params":[
			"param1",
			"rap"
		],
		"results" : "result",
		"script-valid":true
	},
	{
		"params":[
			"param1",
			"rap"
		],
		"results" : "result",
		"valid":true
	}
]
  • 404: Process not found
 

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
{
	"script" : "script"
}
  • 204: No code available at this time from Queue

  • 400: Bad Headers

  • 404: Process Not Found

  • 409: Conflict (duplicate results)

Top

RTO Ping (Reset Time Out)

  • Tell the server to reset its process timer for the indicated segment
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:

  • 201: Created new timer process

  • 404: Process Not Found

Top

Environment

Top

Environment Segment

  • Segment of a simulation
  • Sent to bot as string representing a file contents unifying script and relevant parameters
  • Returned to user as string of results

Top

#Appendix

Flowchart Key

  • Yellow: Start
  • Green: Data received
  • Red: Response sent
  • Black: Segments created

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

 
 
 

Contributors

Languages

  • Java 94.1%
  • Python 4.9%
  • Shell 1.0%