MoMa visiter circulation

zx2263
Data Mining the City
2 min readSep 26, 2018

Final project proposal:

My proposal for final project is by controlling traffic signal to reduce traffic jam inside NYC. During commute period of weekday, particular areas inside NYC always have traffic jam and need police to manage at intersection. Traffic signal system has a important role to reduce pressure of commute by manage red and green light time of signal, interval and frequency of traffic light and relationship of timing among near by intersection. Trying to develop a traffic signal system to reduce traffic jam in NYC

MoMa visiter circulation

To research the behavior of visiter in museum, I use MoMa fifth floor that floor with permanent painting exhibition to illustrate it. Inside museum, there always are two groups of visiter. One is more focus on painting. They walk slowly and will stand in front of each painting to appreciate art and connect with art. The other is people do not have that much of time or do not have patient for each works. They walk much faster and just focus on few famous work. Red figure is people move fast and blue figure represent people move slow.

here use circle instead of figure to show movement clearly

def setup():
size(600,520)
global fvisiter, svisiter, fpopulationSize, spopulationSize
fpopulationSize = 90
spopulationSize = 60

fvisiter = []
for x in xrange (fpopulationSize):
fvisiter.append(FMover())

svisiter = []
for x in xrange (spopulationSize):
svisiter.append(SMover())
def draw():
#background
# make a new instance of a PImage by loading an image file
# decalring a variable of type PImage
fimg = loadImage("floorplan.png")
image(fimg,0,0,600,520)

for i in xrange(fpopulationSize):
noiseDetail(10, 0.5)
fvisiter[i].update()
fvisiter[i].checkEdges()
fvisiter[i].display()

for i in xrange(spopulationSize):
noiseDetail(10, 0.5)
svisiter[i].update()
svisiter[i].checkEdges()
svisiter[i].display()

class FMover(object):
def __init__(self):
self.location = PVector(random(500),random(500))
self.velocity = PVector(0, 0)
self.topspeed = 100

def update(self):
self.acceleration = PVector.random2D()
self.acceleration.mult(random(2))
self.velocity.add(self.acceleration)
self.velocity.limit(self.topspeed)
self.location.add(self.velocity)

def display(self):
img = loadImage("17447-1.png")
image(img, self.location.x, self.location.y, 20, 20)

def checkEdges(self):
if self.location.x > width:
self.location.x = 0
elif self.location.x < 0:
self.location.x = width
if self.location.y > height:
self.location.y = 0
elif self.location.y < 0:
self.location.y = height

class SMover(object):
def __init__(self):
self.location = PVector(random(500),random(500))
self.velocity = PVector(0, 0)
self.topspeed = 2

def update(self):
self.acceleration = PVector.random2D()
self.acceleration.mult(random(2))
self.velocity.add(self.acceleration)
self.velocity.limit(self.topspeed)
self.location.add(self.velocity)

def display(self):
img = loadImage("17447-2.png")
image(img, self.location.x, self.location.y, 20, 20)

def checkEdges(self):
if self.location.x > width:
self.location.x = 0
elif self.location.x < 0:
self.location.x = width
if self.location.y > height:
self.location.y = 0
elif self.location.y < 0:
self.location.y = height

--

--