List of commits:
Subject Hash Author Date (UTC)
Pedestrian don't think they're cars anymore! Also small code cleanup. 7c6e2978497442330d56fd334cf8b33e73c7525a Jan Allersma 2018-01-08 20:53:51
Cars send signal once they're waiting, not before they're waiting. 49fda0804f0e056fe6a060ff13bd1c10408f696e Jan Allersma 2018-01-08 15:57:41
Assessment 8ad5b23b821e160483b919f0f375313ec6dc79be Jan Allersma 2017-12-20 11:37:13
TrafficLights working..? 7f12d9c9d44a2fa556d15e075723ec9c11c8b468 Jan Allersma 2017-12-19 15:22:32
Add lights and fully working train. ee0e851a1b482f162918f8723fc0c62d257aff83 Jan Allersma 2017-12-18 16:59:33
Commit after fixing issues during lecture 93b7f5e88a7a4427867054ebabe0505963b14da0 Jan Allersma 2017-12-13 12:49:55
Some more fixes :D 09f121a8de8ef6f49abbf0a52b0e9d9c033ade58 Jan Allersma 2017-12-09 15:09:38
Also added additional waypoints for 106. 1567c42fbaa689848d2ca2620e37bb83bb30eaf4 Jan Allersma 2017-12-07 13:40:56
Fixed some bugs (See TestResultsSimulator.txt for more info). 7c4466770f8b4da0af1156856a40b32cd11b6d37 Jan Allersma 2017-12-07 13:31:04
Werk van Simulator na testen 05/12/17. 80af7ffb5438b855a2e73fb185ba66c1cd50efe3 Jan Allersma 2017-12-05 09:45:11
Nieuwe plattegrond toegevoegd. b520f51bdd4a4d25e5d1a54cd094cf3b4632a369 Jan Allersma 2017-12-02 14:19:52
More Waypoints! 465108ac6a127bbda26b40989fd6a68cd3e00aad Jan Allersma 2017-11-30 12:52:22
Added voetganger. dad12c3d2eb2a7160838c3495e4a7a2d382e493f Jan Allersma 2017-11-30 12:32:35
Added all waiting waypoints for 1xx. bbba002738e0a26b085673400c76329d3055d8ba Jan Allersma 2017-11-29 12:00:37
Simulation now working correctly for ID's 101, 102 and 103. 1bc2fb65bb75b3a1f63cf7690472152fe1f32564 Jan Allersma 2017-11-28 16:22:53
Autos kunnen gespawned worden en rijden dan de goede richting op. b36ef1cafeda20d5753b72c6f8e6ac8423c42d95 Jan Allersma 2017-11-26 21:44:39
Last changes before test case 5. 258ba4735dfd2078f8e4f034fffed2bbbb086f2a Jan Allersma 2017-11-22 14:08:37
hallo dit is kapot maar het werkt woehoe 4475c2633e962688c71634d633ac8789524f16cf XCBouke 2017-11-22 13:58:54
It's actually working now! With a gameloop and new icons :D 0b65d450fea6d9f679029f2d6765c7e2d1126cdd Jan Allersma 2017-11-20 22:02:23
Something... Works?? 9a6afe028642b571483fccd6d6bdab10dee68e9c Jan Allersma 2017-11-20 15:14:07
Commit 7c6e2978497442330d56fd334cf8b33e73c7525a - Pedestrian don't think they're cars anymore! Also small code cleanup.
Author: Jan Allersma
Author date (UTC): 2018-01-08 20:53
Committer name: Jan Allersma
Committer date (UTC): 2018-01-08 20:53
Parent(s): 49fda0804f0e056fe6a060ff13bd1c10408f696e
Signing key:
Tree: 01fa93d95562419f7bc7eca2da31f2cedb1addd4
File Lines added Lines deleted
simulatie/connection.py 0 25
simulatie/pyg.py 13 12
File simulatie/connection.py changed (mode: 100644) (index d40085a..4c7f529)
... ... def update(index, addCars, dirRequests):
112 112 else: else:
113 113 print("INPUT IS DISABLED!") print("INPUT IS DISABLED!")
114 114
115 def transform(index, original):
116 if inputEnabled:
117 msg = json.dumps({
118 "TrafficUpdate": {
119 "LightId": lights[original][0],
120 "Count": 0,#lights[index][1],
121 "DirectionRequests": None
122 }
123 }, sort_keys=False, indent=4, separators=(',',': '))
124
125 purelySendMsg(msg)
126
127 msg = json.dumps({
128 "TrafficUpdate": {
129 "LightId": lights[index][0],
130 "Count": 1,#lights[index][1],
131 "DirectionRequests": None
132 }
133 }, sort_keys=False, indent=4, separators=(',',': '))
134
135 purelySendMsg(msg)
136
137 else:
138 print("INPUT IS DISABLED!")
139
140 115 def listen(): def listen():
141 116 print('Waiting for a sign..') print('Waiting for a sign..')
142 117 recieve.basic_consume ( recieve.basic_consume (
File simulatie/pyg.py changed (mode: 100644) (index f1fb4e2..1c7e252)
... ... bg = pygame.transform.scale(pygame.image.load("./PlattegrondV5.png"), (800,800))
20 20 class Light(object): class Light(object):
21 21 def __init__(self, lightIndex): def __init__(self, lightIndex):
22 22 self.lamp = pygame.image.load("Light.png") self.lamp = pygame.image.load("Light.png")
23 #self.lamp_tint = self.lamp()
24 23 self.rect = self.lamp.get_rect() self.rect = self.lamp.get_rect()
25 24
26 25 print("Light " + str(lightIndex) + " -> " + str(tm.lightsPos[lightIndex])) print("Light " + str(lightIndex) + " -> " + str(tm.lightsPos[lightIndex]))
 
... ... class Vehicle(object):
101 100 for i in range(0, len(tm.transforms)): for i in range(0, len(tm.transforms)):
102 101 if tm.transforms[i]["from"] == trafficType: if tm.transforms[i]["from"] == trafficType:
103 102 return tm.transforms[i]["to"] return tm.transforms[i]["to"]
104 print("transform found!")
105 103 return 0 return 0
106 104
107 105 def update(self): def update(self):
 
... ... class Vehicle(object):
155 153 print("NW: " + str(self.wp) + " / " + str(len(tm.waypoints[self.trafficId][self.direction]))) print("NW: " + str(self.wp) + " / " + str(len(tm.waypoints[self.trafficId][self.direction])))
156 154
157 155 elif not self.waiting: # Check for transform elif not self.waiting: # Check for transform
158 if str(self.transform) != "0":# and self.transform != None and self.transform != "":
159 #self.trafficId = self.transform
160 self.wp = 1
161 self.waiting = True
156 if str(self.transform) != "0":
162 157
163 158 self.transform = self.checkForTransform() self.transform = self.checkForTransform()
164 connection.transform(self.transform, self.trafficId) # Connection.update moet geen nieuwe vehicle spawnen
165 self.trafficId = self.transform
166 print("TRANSFORM: " + str(self.transform))
159 if self.transform != 0:
160
161 # NOTE:
162 # self.firedUpdate wordt niet meer op false gezet,
163 # aangezien een transform voor het wachten geen pad heeft.
164
165 connection.update(self.transform, 1, None)
166 self.wp = 1
167 self.waiting = True
168 self.trafficId = self.transform
169 print("TRANSFORM: " + str(self.transform))
167 170 else: else:
168 171 pass # Destructor here? pass # Destructor here?
169 172
 
... ... class Vehicle(object):
176 179 return return
177 180 self.waiting = False self.waiting = False
178 181 self.wp = 0 self.wp = 0
179 connection.update(self.trafficId, -1, None)#self.direction)
182 connection.update(self.trafficId, -1, None)
180 183 self.update() self.update()
181 184
182 185 clock = pygame.time.Clock() clock = pygame.time.Clock()
 
... ... clock = pygame.time.Clock()
184 187 def update(jsonObj): def update(jsonObj):
185 188 result = json.loads(jsonObj) result = json.loads(jsonObj)
186 189 tm.lights = result['Lights'] tm.lights = result['Lights']
187 #for i in range(0, len(lights)):
188 #lights[i].lighCheck()
189 190
190 191
191 192 def spawnTrein(naarGroningen): def spawnTrein(naarGroningen):
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/kapstok/NHL-SoftDev

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/kapstok/NHL-SoftDev

Clone this repository using git:
git clone git://git.rocketgit.com/user/kapstok/NHL-SoftDev

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main