Skip to content
Browse files

- added a first pass to the aggregator section

- modified simulator for testing
  • Loading branch information...
1 parent 81b6caf commit 981d8d52310a3cfd0440af2706b7dfcb4f76265e Michael Schultz committed Dec 9, 2010
Showing with 148 additions and 15 deletions.
  1. +38 −0 doc/paper/report.bib
  2. BIN doc/paper/report.pdf
  3. +78 −8 doc/paper/report.tex
  4. +32 −7 src/frontend/
38 doc/paper/report.bib
@@ -10,6 +10,44 @@ @Misc{ pgi:signal-park
+@Misc{ google:appengine,
+ title="Google AppEngine",
+ publisher="Google, Inc.",
+ note="\url{}",
+@Inproceedings{ google:bigtable,
+ author = "Fay Chang and Jeffrey Dean and Sanjay Ghemawat and Wilson C.
+ Hsieh and Deborah A. Wallach and Mike Burrows and Tushar Chandra
+ and Andrew Fikes and Robert E. Gruber",
+ title = {Bigtable: A distributed storage system for structured data},
+ booktitle = {In Proceedings of the 7th Conference on USENIX SymposiuM
+ on Operating Systems Design and Implementation},
+ year = {2006},
+ pages = {205--218},
+ publisher = {}
+@Inproceedings{ pautasso:restful,
+ author = {Pautasso, Cesare and Zimmermann, Olaf and Leymann, Frank},
+ title = {Restful web services vs. "big"' web services: making the right
+ architectural decision},
+ booktitle = {Proceeding of the 17th international conference on World
+ Wide Web},
+ series = {WWW '08},
+ year = {2008},
+ location = {Beijing, China},
+ pages = {805--814},
+ publisher = {ACM},
+ address = {New York, NY, USA},
+@Misc{ geomodel,
+ title="geomodel",
+ note="\url{}",
@Misc{ pgi:streetline,
title="Streetline Parking Management System",
publisher="Streetline, Inc.",
BIN doc/paper/report.pdf
Binary file not shown.
86 doc/paper/report.tex
@@ -208,17 +208,87 @@ \subsection{Collection Software}
transportation systems.
% end from proposal
\subsection{Aggregation Software}
-A paragraph laying out what Google AppEngine is, why we chose it, and what
-it does for us.
-A paragraph or two describing the AE backend and frontend(s).
+Data leaving the base station of a parking lot is directed over then
+Internet to our aggregation software hosted on Google's
+For this project, we decided the AppEngine environment was an appropriate
+choice for several reasons:
+ \item The service is free for light usage (testing and development).
+ \item It provides a Python programming environment.
+ \item Most importantly, it is designed to scale up with ease
+ transparently with large datasets.
-More detailed description of the underlying implementation (packet formats
-in the network, sending data to AppEngine, specific technology used on
-backend, any frontend stuff).
+The nature of our project is to have one sensor per parking space in a
+parking lot for every parking lot.
+This implies that over time our backend must be able to accept, store, and
+recall large amounts of current and historical data.
+We could have sunk our resources into using a traditional server model for
+the purposes of a prototype, however if the project were to start scaling
+up great amounts we would start running into resource barriers.
+Google's AppEngine is designed to scale with demand, this is largely due to
+their use of a datastore built on top of Bigtable~\cite{google:bigtable}.
+Though transparent to users of our system, this non-SQL based datastore
+forced a few notable differences from a SQL based datastore.
+First, while queries appear to be SQL, they are actually ``GQL,'' a
+SQL-like language.
+In general this does not bring any problems, but because of the
+organization of the datastore imprecise queries are not acceptable.
+You must know the data you are looking for.
+You cannot simple SELECT one or two columns from the datastore, rather you
+must get all the columns or a unique key identifier that matches the query.
+Second, its harder to perform proximity searches with the datastore because
+there is not concept of ``similar'' or ``like'' queries, you either know
+the data or don't know the data.
+However, with the help of the geomodel API~\cite{geomodel} we are able to
+use geohashing to perform proximity searches on the datastore.
+This is useful to locate nearby parking lots, allowing the end-user to
+identify other potential parking areas.
+With an understanding of the underlying technology, we are able to present
+an easy to use API.
+\subsubsection{A RESTful API}
+REpresentational State Transfer (REST) is an abstract model for building
+large-scale web services~\cite{pautasso:restful}.
+The principles of a RESTful architecture are an identification of resources
+through a URI, a ``pure'' HTTP interface, and self-contained hyperlinks.
+In this section we describe how we achieved these principles.
+Our URI scheme is straight-forward.
+Each lot is given a unique identification consisting of alphanumerics and
+the underscore (\_) character.
+When attempting to access a specific lot, that identifier is part of the
+URI (i.e.,
+identifies the Milbrook lot on Washington University's campus).
+Any request concerning this lot must go through its URI.
+Requests use one of the HTTP verbs of \texttt{GET}, \texttt{PUT}, or
+A \texttt{GET} request simply returns the information for the requested URI
+in either the HTML or JSON format.
+A \texttt{PUT} request attempts to store updated status information to the
+This request contains the list of parking spaces to update, their
+identification and status, as well as any associated meta-information that
+should be put in the datastore.
+Finally, a \texttt{POST} request handles the creation of new parking lots.
+With the API in place, we are able to create rich applications with ease
+for expansion and integration into other software.
+As a demonstration, we build up a web-based frontend in the next section
+that takes advantage of our API.
+\subsubsection{Web Frontend}
+Explanation of the frontend will go here.
39 src/frontend/
@@ -4,6 +4,9 @@
import sys
import random
import json
+import time
+from datetime import datetime as dtdt
+from datetime import time as dtt
if len(sys.argv) >= 2 :
hostname = sys.argv[1]
@@ -19,17 +22,39 @@ def space_list(min, max, items) :
for i in range(items) :
yield random.randint(min,max)
-host = httplib.HTTPConnection(hostname)
simulating = True
while simulating :
+ host = httplib.HTTPConnection(hostname)
print 'PUT to',hostname,'in lot',lotname,'...',
# generage a random number of spaces to change
spaces = []
- changed = random.randint(1, 8)
- for space_id in space_list(0, 10, changed) :
+ changed = random.randint(1, 10)
+ now =
+ six_oclock = dtdt.combine(, dtt(6, 00))
+ seven_oclock = dtdt.combine(, dtt(7, 00))
+ twelve_oclock = dtdt.combine(, dtt(12, 00))
+ thirteen_oclock = dtdt.combine(, dtt(13, 00))
+ eighteen_oclock = dtdt.combine(, dtt(18, 00))
+ nineteen_oclock = dtdt.combine(, dtt(19, 00))
+ twentytwo_oclock = dtdt.combine(, dtt(22, 00))
+ five_oclock = dtdt.combine(, dtt(5, 00))
+ if six_oclock <= now <= seven_oclock :
+ weight = 3
+ elif twelve_oclock <= now <= thirteen_oclock :
+ changed *= 2
+ weight = 3
+ elif eighteen_oclock <= now <= nineteen_oclock :
+ weight = 3
+ elif now >= twentytwo_oclock or now <= five_oclock :
+ weight = 5
+ changed /= 2
+ else :
+ weight = 1
+ for space_id in space_list(0, 30, changed) :
space = {'space_id': space_id,
- 'is_empty': bool(random.randint(0,1))}
+ 'is_empty': bool(random.randint(0,weight))}
for thing in ('temperature','sonar','light','magnet') :
if bool(random.randint(0,1)) :
space[thing] = int(random.random()*256)
@@ -48,8 +73,8 @@ def space_list(min, max, items) :
del space['is_empty']
print '\t'+str(space)
- next_round = raw_input('Continue (Y/n): ')
- if next_round not in ('', 'yes', 'y', 'Y') :
- simulating = False
+ host.close()
+ time.sleep(90+random.randint(-30,30))
+ # sleeps between 60 and 120 seconds
print 'Done.'

0 comments on commit 981d8d5

Please sign in to comment.
Something went wrong with that request. Please try again.