Newer
Older
{
"cells": [
{
"cell_type": "markdown",
{
"cell_type": "markdown",
"id": "1c5d41dc",
"metadata": {},
"source": [
"Formulieren Sie eine oder mehrere Forschungsfragen zu der Lerneinheit:"
]
},
{
"cell_type": "markdown",
"id": "14e306b5",
"metadata": {},
"source": [
"Mit welchen Konfigurationen lässt sich die Qualität eines Elektrofahrzeugs in Bezug auf Aufwand, Verfügbarkeit und Akzeptanz optimieren?"
]
{
"cell_type": "markdown",
"id": "de070039",
"metadata": {},
"source": [
{
"cell_type": "markdown",
"id": "531d890a",
"metadata": {},
"source": [
"### Versuchsziel\n",
"Formulieren Sie ein Versuchsziel für diesen ersten Versuch:"
]
},
{
"cell_type": "markdown",
"id": "30ddd8dc",
"metadata": {},
"source": [
"Bestimmen Sie, wie sich verschiedene Elemente des Fahrzeugs (z. B. das Antriebssystem und die Art der Teile) auf die Qualitäts-KPIs auswirken, um das Design in zukünftigen Iterationen zu optimieren."
]
},
{
"cell_type": "markdown",
"id": "50dd9ff3",
"metadata": {},
"source": [
"### Versuchsaufbau\n",
"\n",
"Bauen Sie ein erstes Fahrzeug aus den gegebenen LEGO-Teilen in der CAD-Software LeoCAD auf.\n",
"\n",
"Hierbei gelten die folgenden Rahmenbedingungen:\n",
"- Das Fahrzeug muss aus Baugruppen, Bauteilen und Komponenten bestehen.\n",
"- Es muss mindestens vier Räder besitzen\n",
"- Es muss sich durch den elektrischen Antrieb fortbewegen können. \n",
"- Die Verwendung eines Getriebes zwischen Motor und Antriebsachse(n) ist verpflichtend. \n",
"- Die Farbe von mindestens einem Teil soll sich von der in LeoCAD hinterlegten Standardfarbe unterscheiden.\n",
"- Es sind nur die LEGO-Teile zu verwenden, welche sich in den JSON-Dateien bzw. in\n",
"der zur Verfügung gestellten Teilebibliothek befinden."
]
},
{
"cell_type": "markdown",
"id": "0ebba2d8",
"metadata": {},
"source": [
"Fügen Sie eine Abbildung des fertigen Autos in LeoCAD hinzu (*Hinweise: Ein Bild lässt sich mit \\!\\[Bildbeschreibung](/Pfad/zum/Bild) hinzufügen. Achten Sie darauf, das Bild später auch in Git hinzuzufügen*):\n"

Rivera Alcalde, Andrés Daniel
committed
"attachments": {},
"cell_type": "markdown",
"id": "935c200c",
"metadata": {},

Rivera Alcalde, Andrés Daniel
committed
"source": [

Rivera Alcalde, Andrés Daniel
committed
"\n",
""

Rivera Alcalde, Andrés Daniel
committed
]
{
"cell_type": "markdown",
"id": "05a8eb21",
"metadata": {},
"source": [
"Beschreiben Sie kurz und präzise Ihr Fahrzeug:"
"cell_type": "markdown",
"id": "df7f1d01",
"metadata": {},

Rivera Alcalde, Andrés Daniel
committed
"source": [
"Das folgende Bild zeigt das in LeoCAD erstellte Auto aus dem ersten Versuchsaufbau. Es wurde aus mehreren Teilen zusammengesetzt, bestehend aus einem vierrädrigen Fahrzeug, einem Motor, einer Batterie und einem Getriebe."
]
},
{
"cell_type": "markdown",
"id": "e622f83b",
"Bauen Sie das Fahrzeug nun in unserem Software-Framework zusammen. Instanziieren Sie die LEGO-Teile und lesen Sie dabei auch die Eigenschaften ein. Ergänzen Sie zusätzliche Eigenschaften, wie z.B. die Farbe. Referenzieren Sie die Teile aufeinander und erstellen Sie auf diese Weise sinnvolle Bauteile, Baugruppen und das\n",
"Gesamtsystem. Nutzen Sie die hierfür bereitgestellten Klassendefinitionen und Methoden. Achten Sie auf eine gute Code-Dokumentation. Sie können sich für die Bearbeitung an den zur Verfügung gestellten Code-Zellen orientieren, können hiervon jedoch auch abweichen.\n",
"\n",
"*Hinweise: Achten Sie auf die Unterschiede zum Minimalbeispiel. Eine direkte Kopie ist nicht möglich. Achten Sie außerdem darauf, ein Teil (eindeutig identifiziert durch seine UUID) nicht an mehreren Stellen zu verbauen*"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "690da270",
"metadata": {},
"outputs": [],
"source": [
"import json\n",
"import pprint\n",
"from functions import calculation_rules\n",
"from functions.classes import *"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"# initialize components\n",
"\n",
"with open(\"datasheets/axles.json\") as json_file:\n",

Rivera Alcalde, Andrés Daniel
committed
" axles_data = json.load(json_file)\n",
"with open(\"datasheets/motors.json\") as json_file:\n",

Rivera Alcalde, Andrés Daniel
committed
" motors_data = json.load(json_file)\n",
"with open(\"datasheets/gears.json\") as json_file:\n",

Rivera Alcalde, Andrés Daniel
committed
" gears_data = json.load(json_file)\n",
"with open(\"datasheets/batteries.json\") as json_file:\n",

Rivera Alcalde, Andrés Daniel
committed
" batteries_data = json.load(json_file)\n",
"with open(\"datasheets/frame.json\") as json_file:\n",

Rivera Alcalde, Andrés Daniel
committed
" frame_data = json.load(json_file)\n",
"with open(\"datasheets/tires.json\") as json_file:\n",

Rivera Alcalde, Andrés Daniel
committed
" tires_data = json.load(json_file)\n",
"with open(\"datasheets/rims.json\") as json_file:\n",

Rivera Alcalde, Andrés Daniel
committed
" rims_data = json.load(json_file)\n",
"\n",
"\n",
"battery = LegoComponent(\"battery\", batteries_data[\"8881-1\"])\n",
"\n",
"green_base = LegoComponent(\"green base\", frame_data[\"39790\"])\n",
"\n",
"motor = LegoComponent(\"Motor\", motors_data[\"88003-1\"])\n",
"\n",
"axle_input = LegoComponent(\"axle input\", axles_data[\"32073\"])\n",
"\n",
"antrieb_gear = LegoComponent(\"antrieb gear\", gears_data[\"18575\"])\n",
"abtrieb_gear = LegoComponent(\"abtrieb gear\", gears_data[\"94925\"])\n",
"\n",
"axle_side_1 = LegoComponent(\"axle side 1\", axles_data[\"50451\"])\n",
"axles=[axle_side_1]\n",
"for i in range (2,4):\n",

Rivera Alcalde, Andrés Daniel
committed
" cloned_axle=axle_side_1.clone(f\"axle_side_{i}\")\n",
" axles.append(cloned_axle)\n",
"\n",
"tire_1 = LegoComponent(\"tire 1\", tires_data[\"30699\"])\n",
"tires=[tire_1]\n",
"for i in range (2,5):\n",

Rivera Alcalde, Andrés Daniel
committed
" cloned_tire=tire_1.clone(f\"tire_{i}\")\n",
" tires.append(cloned_tire)\n",
"\n",
"rim_1 = LegoComponent(\"rim 1\", rims_data[\"56904\"])\n",
"rims=[rim_1]\n",
"for i in range (2,5):\n",

Rivera Alcalde, Andrés Daniel
committed
" cloned_rim=rim_1.clone(f\"rim_{i}\")\n",
" rims.append(cloned_rim)\n",
"\n",
"technic_bush_1 = LegoComponent(\"technic bush 1\", frame_data[\"32123\"])\n",

Rivera Alcalde, Andrés Daniel
committed
"technic_bushes=[technic_bush_1]\n",
"for i in range (2,7):\n",

Rivera Alcalde, Andrés Daniel
committed
" cloned_technic_bush=technic_bush_1.clone(f\"technic_bush_{i}\")\n",
" technic_bushes.append(cloned_technic_bush)\n",
"\n",
"technic_pin_1=LegoComponent(\"technic pin 1\", frame_data[\"55615\"])\n",
"technic_pins=[technic_pin_1]\n",
"for i in range (2,7):\n",

Rivera Alcalde, Andrés Daniel
committed
" cloned_technic_pin=technic_pin_1.clone(f\"technic_pin_{i}\")\n",

Rivera Alcalde, Andrés Daniel
committed
" technic_pins.append(cloned_technic_pin)\n"
]
},
{
"cell_type": "code",
"execution_count": 3,
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'category': 'battery',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?S=8881-1',\n",
" 'delivery time [days]': 3,\n",
" 'dimensions [cm]': '8,8 x 6,3 x 3,2',\n",
" 'environmental impact [kg CO2e /kg]': 6.95,\n",
" 'item description': 'Power Functions Battery Box',\n",
" 'item number': '8881-1',\n",
" 'label': 'battery',\n",
" 'mass [g]': 179.4,\n",
" 'output voltage [V]': 9,\n",
" 'price [Euro]': 12,\n",
" 'related items': '8882-1, 8883-1, 88003-1'}\n",
"{'category': 'frame',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=39790',\n",
" 'delivery time [days]': 3,\n",
" 'dimension [studs]': '11 x 15 x 1',\n",
" 'environmental impact [kg CO2e /kg]': 11.93,\n",
" 'item description': 'Technic, Liftarm, Modified Frame Thick 11 x 15 Open '\n",
" 'Center',\n",
" 'item number': 39790,\n",
" 'label': 'green base',\n",
" 'mass [g]': 12.96,\n",
" 'price [Euro]': 2.19}\n",
"{'category': 'motor',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?S=88003-1',\n",
" 'delivery time [days]': 3,\n",
" 'dimensions [cm]': '13 x 11 x 2.5',\n",
" 'environmental impact [kg CO2e /kg]': 15.84,\n",
" 'idle current [mA]': 120,\n",
" 'idle speed [rev per min]': 390,\n",
" 'input voltage [V]': 9,\n",
" 'item description': 'Power Functions L-Motor',\n",
" 'item number': '88003-1',\n",
" 'label': 'Motor',\n",
" 'locking torque [Ncm]': 18,\n",
" 'mass [g]': 48.0,\n",
" 'price [Euro]': 15,\n",
" 'related items': '8881-1'}\n",
"{'category': 'axle',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=32073',\n",
" 'delivery time [days]': 3,\n",
" 'dimension [studs]': 5,\n",
" 'environmental impact [kg CO2e /kg]': 11.03,\n",
" 'item description': 'Axle 5 studs',\n",
" 'item number': 32073,\n",
" 'label': 'axle input',\n",
" 'mass [g]': 0.66,\n",
" 'price [Euro]': 0.001}\n",
"{'category': 'gear',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=32269',\n",
" 'delivery time [days]': 13,\n",
" 'environmental impact [kg CO2e /kg]': 32.06,\n",
" 'item description': 'Gear 20 Tooth Double Bevel',\n",
" 'item number': 18575,\n",
" 'label': 'antrieb gear',\n",
" 'mass [g]': 1.4,\n",
" 'price [Euro]': 0.36}\n",
"{'category': 'gear',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=94925',\n",
" 'delivery time [days]': 12,\n",
" 'environmental impact [kg CO2e /kg]': 32.06,\n",
" 'item description': 'Gear 16 Tooth',\n",
" 'item number': 94925,\n",
" 'label': 'abtrieb gear',\n",
" 'mass [g]': 0.7,\n",
" 'price [Euro]': 0.2}\n",
"{'category': 'axle',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=50451',\n",
" 'delivery time [days]': 3,\n",
" 'dimension [studs]': 16,\n",
" 'environmental impact [kg CO2e /kg]': 11.03,\n",
" 'item description': 'Axle 16 studs',\n",
" 'item number': 50451,\n",
" 'label': 'axle side 1',\n",
" 'mass [g]': 2.37,\n",
" 'price [Euro]': 0.75}\n",
"{'category': 'axle',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=50451',\n",
" 'delivery time [days]': 3,\n",
" 'dimension [studs]': 16,\n",
" 'environmental impact [kg CO2e /kg]': 11.03,\n",
" 'item description': 'Axle 16 studs',\n",
" 'item number': 50451,\n",
" 'label': 'axle_side_2',\n",
" 'mass [g]': 2.37,\n",
" 'price [Euro]': 0.75}\n",
"{'category': 'axle',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=50451',\n",
" 'delivery time [days]': 3,\n",
" 'dimension [studs]': 16,\n",
" 'environmental impact [kg CO2e /kg]': 11.03,\n",
" 'item description': 'Axle 16 studs',\n",
" 'item number': 50451,\n",
" 'label': 'axle_side_3',\n",
" 'mass [g]': 2.37,\n",
" 'price [Euro]': 0.75}\n",
"{'category': 'tire',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=30699',\n",
" 'delivery time [days]': 5,\n",
" 'environmental impact [kg CO2e /kg]': 8.97,\n",
" 'inner diameter [mm]': 30,\n",
" 'item description': 'Tire 43.2 x 14 Solid',\n",
" 'item number': 30699,\n",
" 'label': 'tire 1',\n",
" 'mass [g]': 8.25,\n",
" 'outer diameter [mm]': 43.2,\n",
" 'price [Euro]': 0.06,\n",
" 'related items': 56904}\n",
"{'category': 'tire',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=30699',\n",
" 'delivery time [days]': 5,\n",
" 'environmental impact [kg CO2e /kg]': 8.97,\n",
" 'inner diameter [mm]': 30,\n",
" 'item description': 'Tire 43.2 x 14 Solid',\n",
" 'item number': 30699,\n",
" 'label': 'tire_2',\n",
" 'mass [g]': 8.25,\n",
" 'outer diameter [mm]': 43.2,\n",
" 'price [Euro]': 0.06,\n",
" 'related items': 56904}\n",
"{'category': 'tire',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=30699',\n",
" 'delivery time [days]': 5,\n",
" 'environmental impact [kg CO2e /kg]': 8.97,\n",
" 'inner diameter [mm]': 30,\n",
" 'item description': 'Tire 43.2 x 14 Solid',\n",
" 'item number': 30699,\n",
" 'label': 'tire_3',\n",
" 'mass [g]': 8.25,\n",
" 'outer diameter [mm]': 43.2,\n",
" 'price [Euro]': 0.06,\n",
" 'related items': 56904}\n",
"{'category': 'tire',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=30699',\n",
" 'delivery time [days]': 5,\n",
" 'environmental impact [kg CO2e /kg]': 8.97,\n",
" 'inner diameter [mm]': 30,\n",
" 'item description': 'Tire 43.2 x 14 Solid',\n",
" 'item number': 30699,\n",
" 'label': 'tire_4',\n",
" 'mass [g]': 8.25,\n",
" 'outer diameter [mm]': 43.2,\n",
" 'price [Euro]': 0.06,\n",
" 'related items': 56904}\n",
"{'category': 'rim',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=56904',\n",
" 'delivery time [days]': 5,\n",
" 'diameter [mm]': 30.0,\n",
" 'environmental impact [kg CO2e /kg]': 32.06,\n",
" 'item description': 'Wheel 30mm D. x 14mm',\n",
" 'item number': 56904,\n",
" 'label': 'rim 1',\n",
" 'mass [g]': 4.1,\n",
" 'price [Euro]': 0.01,\n",
" 'related items': 30699}\n",
"{'category': 'rim',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=56904',\n",
" 'delivery time [days]': 5,\n",
" 'diameter [mm]': 30.0,\n",
" 'environmental impact [kg CO2e /kg]': 32.06,\n",
" 'item description': 'Wheel 30mm D. x 14mm',\n",
" 'item number': 56904,\n",
" 'label': 'rim_2',\n",
" 'mass [g]': 4.1,\n",
" 'price [Euro]': 0.01,\n",
" 'related items': 30699}\n",
"{'category': 'rim',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=56904',\n",
" 'delivery time [days]': 5,\n",
" 'diameter [mm]': 30.0,\n",
" 'environmental impact [kg CO2e /kg]': 32.06,\n",
" 'item description': 'Wheel 30mm D. x 14mm',\n",
" 'item number': 56904,\n",
" 'label': 'rim_3',\n",
" 'mass [g]': 4.1,\n",
" 'price [Euro]': 0.01,\n",
" 'related items': 30699}\n",
"{'category': 'rim',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=56904',\n",
" 'delivery time [days]': 5,\n",
" 'diameter [mm]': 30.0,\n",
" 'environmental impact [kg CO2e /kg]': 32.06,\n",
" 'item description': 'Wheel 30mm D. x 14mm',\n",
" 'item number': 56904,\n",
" 'label': 'rim_4',\n",
" 'mass [g]': 4.1,\n",
" 'price [Euro]': 0.01,\n",
" 'related items': 30699}\n",
"{'category': 'frame',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=4265c',\n",
" 'delivery time [days]': 3,\n",
" 'dimension [studs]': 1,\n",
" 'environmental impact [kg CO2e /kg]': 11.93,\n",
" 'item description': 'Technic Bush 1/2 Smooth',\n",
" 'item number': 32123,\n",
" 'label': 'technic bush 1',\n",
" 'mass [g]': 0.01,\n",
" 'price [Euro]': 0.01}\n",
"{'category': 'frame',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=4265c',\n",
" 'delivery time [days]': 3,\n",
" 'dimension [studs]': 1,\n",
" 'environmental impact [kg CO2e /kg]': 11.93,\n",
" 'item description': 'Technic Bush 1/2 Smooth',\n",
" 'item number': 32123,\n",
" 'label': 'technic_bush_2',\n",
" 'mass [g]': 0.01,\n",
" 'price [Euro]': 0.01}\n",
"{'category': 'frame',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=4265c',\n",
" 'delivery time [days]': 3,\n",
" 'dimension [studs]': 1,\n",
" 'environmental impact [kg CO2e /kg]': 11.93,\n",
" 'item description': 'Technic Bush 1/2 Smooth',\n",
" 'item number': 32123,\n",
" 'label': 'technic_bush_3',\n",
" 'mass [g]': 0.01,\n",
" 'price [Euro]': 0.01}\n",
"{'category': 'frame',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=4265c',\n",
" 'delivery time [days]': 3,\n",
" 'dimension [studs]': 1,\n",
" 'environmental impact [kg CO2e /kg]': 11.93,\n",
" 'item description': 'Technic Bush 1/2 Smooth',\n",
" 'item number': 32123,\n",
" 'label': 'technic_bush_4',\n",
" 'mass [g]': 0.01,\n",
" 'price [Euro]': 0.01}\n",
"{'category': 'frame',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=4265c',\n",
" 'delivery time [days]': 3,\n",
" 'dimension [studs]': 1,\n",
" 'environmental impact [kg CO2e /kg]': 11.93,\n",
" 'item description': 'Technic Bush 1/2 Smooth',\n",
" 'item number': 32123,\n",
" 'label': 'technic_bush_5',\n",
" 'mass [g]': 0.01,\n",
" 'price [Euro]': 0.01}\n",
"{'category': 'frame',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=4265c',\n",
" 'delivery time [days]': 3,\n",
" 'dimension [studs]': 1,\n",
" 'environmental impact [kg CO2e /kg]': 11.93,\n",
" 'item description': 'Technic Bush 1/2 Smooth',\n",
" 'item number': 32123,\n",
" 'label': 'technic_bush_6',\n",
" 'mass [g]': 0.01,\n",
" 'price [Euro]': 0.01}\n",
"{'category': 'frame',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=55615',\n",
" 'delivery time [days]': 5,\n",
" 'dimension [studs]': '4 x 4 x 1',\n",
" 'environmental impact [kg CO2e /kg]': 11.93,\n",
" 'item description': 'Technic, Pin Connector Perpendicular 3 x 3 Bent with 4 '\n",
" 'Pins',\n",
" 'item number': 55615,\n",
" 'label': 'technic pin 1',\n",
" 'mass [g]': 1.9,\n",
" 'price [Euro]': 0.1}\n",
"{'category': 'frame',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=55615',\n",
" 'delivery time [days]': 5,\n",
" 'dimension [studs]': '4 x 4 x 1',\n",
" 'environmental impact [kg CO2e /kg]': 11.93,\n",
" 'item description': 'Technic, Pin Connector Perpendicular 3 x 3 Bent with 4 '\n",
" 'Pins',\n",
" 'item number': 55615,\n",
" 'label': 'technic_pin_2',\n",
" 'mass [g]': 1.9,\n",
" 'price [Euro]': 0.1}\n",
"{'category': 'frame',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=55615',\n",
" 'delivery time [days]': 5,\n",
" 'dimension [studs]': '4 x 4 x 1',\n",
" 'environmental impact [kg CO2e /kg]': 11.93,\n",
" 'item description': 'Technic, Pin Connector Perpendicular 3 x 3 Bent with 4 '\n",
" 'Pins',\n",
" 'item number': 55615,\n",
" 'label': 'technic_pin_3',\n",
" 'mass [g]': 1.9,\n",
" 'price [Euro]': 0.1}\n",
"{'category': 'frame',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=55615',\n",
" 'delivery time [days]': 5,\n",
" 'dimension [studs]': '4 x 4 x 1',\n",
" 'environmental impact [kg CO2e /kg]': 11.93,\n",
" 'item description': 'Technic, Pin Connector Perpendicular 3 x 3 Bent with 4 '\n",
" 'Pins',\n",
" 'item number': 55615,\n",
" 'label': 'technic_pin_4',\n",
" 'mass [g]': 1.9,\n",
" 'price [Euro]': 0.1}\n",
"{'category': 'frame',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=55615',\n",
" 'delivery time [days]': 5,\n",
" 'dimension [studs]': '4 x 4 x 1',\n",
" 'environmental impact [kg CO2e /kg]': 11.93,\n",
" 'item description': 'Technic, Pin Connector Perpendicular 3 x 3 Bent with 4 '\n",
" 'Pins',\n",
" 'item number': 55615,\n",
" 'label': 'technic_pin_5',\n",
" 'mass [g]': 1.9,\n",
" 'price [Euro]': 0.1}\n",
"{'category': 'frame',\n",
" 'color': 'Light Grey',\n",
" 'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=55615',\n",
" 'delivery time [days]': 5,\n",
" 'dimension [studs]': '4 x 4 x 1',\n",
" 'environmental impact [kg CO2e /kg]': 11.93,\n",
" 'item description': 'Technic, Pin Connector Perpendicular 3 x 3 Bent with 4 '\n",
" 'Pins',\n",
" 'item number': 55615,\n",
" 'label': 'technic_pin_6',\n",
" 'mass [g]': 1.9,\n",
" 'price [Euro]': 0.1}\n"
]
}
],
"# set properties\n",
"\n",
"\n",
"color = \"Light Grey\"\n",
"\n",
"\n",
"components_teile = [battery, green_base, motor, axle_input, antrieb_gear, abtrieb_gear] + axles + tires + rims + technic_bushes + technic_pins\n",
"\n",
"\n",
"for component in components_teile:\n",
" component.properties[\"color\"] = color\n",
"\n",
"\n",
"for component in components_teile:\n",
" pprint.pprint(component.properties)\n",
"\n",
"\n",
"green_base.properties[\"color\"] = \"Green\"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"LegoAssembly entire auto assembly [0da74173-bb3a-4c6c-af4c-67df69223b9d]\n",
"├── LegoAssembly frame axles [05fe82ce-c47a-4965-b308-18406555ee43]\n",
"│ ├── LegoAssembly antrieb axle [cade2d1a-c4f9-4a7c-ad24-fa5997393b1b]\n",
"│ │ ├── LegoComponent axle_side_3 [0772b2dd-33e1-4551-ae61-32e5c4653368]\n",
"│ │ └── LegoComponent abtrieb gear [db86936d-727b-4b90-a301-e475193b1898]\n",
"│ ├── LegoComponent green base [c980af52-11dd-459c-b7b6-959123ef8023]\n",
"│ ├── LegoComponent axle side 1 [ad474372-d51d-4be6-921a-43c9e9f77190]\n",
"│ └── LegoComponent axle_side_2 [429df643-1576-4f96-bf83-212c9930b571]\n",
"├── LegoAssembly wheel_1 [3ef2632b-f457-4a87-9872-303ccb3001d4]\n",
"│ ├── LegoComponent rim 1 [40f25c52-5415-4b87-a02e-7643c247ffbb]\n",
"│ └── LegoComponent tire 1 [87ffb14a-4a7f-4b80-bc94-f46f4487ce8d]\n",
"├── LegoAssembly wheel_2 [dad09299-f630-45cf-8d2d-8d2f37ce18dd]\n",
"│ ├── LegoComponent rim_2 [36b52291-e193-45d7-b9d4-0714df541686]\n",
"│ └── LegoComponent tire_2 [b5b942ba-2e68-4d3f-a12e-cb4b96b1775f]\n",
"├── LegoAssembly wheel_3 [0f28f992-96a3-4608-91fa-5acf9fc4dd51]\n",
"│ ├── LegoComponent rim_3 [9c4ab815-120e-45e4-b30f-aef3f99189a5]\n",
"│ └── LegoComponent tire_3 [02f7b33d-17b8-429f-9381-40a57e3c2edd]\n",
"├── LegoAssembly wheel_4 [391c62ef-f0f2-4786-8943-219fd8ae08bf]\n",
"│ ├── LegoComponent rim_4 [08c7d7bb-3405-4d52-bb16-19a9eaf5a219]\n",
"│ └── LegoComponent tire_4 [a7a496c1-07f2-4df1-9542-b1c00771584b]\n",
"├── LegoAssembly pinned battery [f1d4a574-658d-4274-8fc4-8cffa8fbd143]\n",
"│ ├── LegoComponent battery [9c4503c1-8017-4804-a102-b073e975da79]\n",
"│ ├── LegoComponent technic pin 1 [d830d372-ab1c-406d-b08b-0cd679f2b613]\n",
"│ ├── LegoComponent technic_pin_2 [c0eff180-28d6-4d0a-bec1-c88ae07e45a0]\n",
"│ ├── LegoComponent technic_pin_3 [2a39faf8-e630-4fda-9d79-b2983caf45de]\n",
"│ └── LegoComponent technic_pin_4 [4ef8b7be-369c-45b2-9566-e45c678b6991]\n",
"├── LegoAssembly pinned motor [c242f8f6-9db1-4ff9-bd1e-b3a46d5a6c49]\n",
"│ ├── LegoAssembly entire drive motor [8f0339f5-79d1-49b8-a962-9325bc04a174]\n",
"│ │ ├── LegoComponent Motor [fbbeb51b-afb1-4725-a9f5-de065ba485ae]\n",
"│ │ ├── LegoComponent axle input [7773b86d-93c3-469b-814e-89931bec62a7]\n",
"│ │ └── LegoComponent antrieb gear [144644cf-ae94-434d-ae29-1488f996c59d]\n",
"│ ├── LegoComponent technic_pin_5 [f2a92fcc-62b4-4980-b932-958cf5f1c41c]\n",
"│ └── LegoComponent technic_pin_6 [bf67b09e-238d-459c-bef3-15f3c92686d3]\n",
"├── LegoComponent technic bush 1 [5b61c623-7f82-4e54-a5f9-9f40f0bf9721]\n",
"├── LegoComponent technic_bush_2 [094b65c5-6f80-4ca8-a724-a217b8e29f45]\n",
"├── LegoComponent technic_bush_3 [47ea0830-596a-407f-9f6f-9e8de6ff575b]\n",
"├── LegoComponent technic_bush_4 [116483f0-7d8f-42ee-93d7-3b574f04cbfd]\n",
"├── LegoComponent technic_bush_5 [8259c9a9-017a-41ec-b5f4-eae4b50964d6]\n",
"└── LegoComponent technic_bush_6 [c2aba687-5137-4ff1-b089-ad7ccd29a8a8]\n"
]
}
],
"# aggregate components\n",

Rivera Alcalde, Andrés Daniel
committed
"\n",
"wheels = []\n",
"\n",
"for i in range(4):\n",
" wheel = LegoAssembly(AggregationLayer.SUBASSEMBLY, f\"wheel_{i+1}\", assembly_method=\"join lego blocks\")\n",
" wheel.add([rims[i], tires[i]])\n",

Rivera Alcalde, Andrés Daniel
committed
" wheels.append(wheel)\n",
"\n",
"antrieb_axle=LegoAssembly(AggregationLayer.SUBASSEMBLY, \"antrieb axle\")\n",

Rivera Alcalde, Andrés Daniel
committed
"antrieb_axle.add([axles[2],abtrieb_gear])\n",
"\n",
"\n",
"frame_axles=LegoAssembly(AggregationLayer.SUBASSEMBLY, \"frame axles\")\n",

Rivera Alcalde, Andrés Daniel
committed
"frame_axles.add([green_base, axles[0], axles[1], antrieb_axle])\n",
"\n",

Rivera Alcalde, Andrés Daniel
committed
"\n",
"\n",
"entire_drive_motor=LegoAssembly(AggregationLayer.SUBASSEMBLY, \"entire drive motor\")\n",

Rivera Alcalde, Andrés Daniel
committed
"entire_drive_motor.add([motor, axle_input,antrieb_gear])\n",
"\n",

Rivera Alcalde, Andrés Daniel
committed
"\n",
"pinned_battery=LegoAssembly(AggregationLayer.SUBASSEMBLY, \"pinned battery\")\n",
"pinned_battery.add([battery, technic_pins[0],technic_pins[1],technic_pins[2],technic_pins[3]])\n",

Rivera Alcalde, Andrés Daniel
committed
"entire_pinned_motor=LegoAssembly(AggregationLayer.ASSEMBLY, \"pinned motor\")\n",
"entire_pinned_motor.add([entire_drive_motor, technic_pins[4],technic_pins[5]])\n",
"\n",
"entire_auto_assembly=LegoAssembly(AggregationLayer.SYSTEM, \"entire auto assembly\")\n",

Rivera Alcalde, Andrés Daniel
committed
"entire_auto_assembly.add([frame_axles,wheels[0],technic_bushes[0],wheels[1],technic_bushes[1],wheels[2],technic_bushes[2],wheels[3],\n",
" technic_bushes[3], technic_bushes[4], technic_bushes[5], pinned_battery, entire_pinned_motor])\n",
"\n",
"print_assembly_tree(entire_auto_assembly)"
]
},
{
"cell_type": "markdown",
"id": "c1fef7f0",
"metadata": {},
"source": [
"### Analyse\n",
"Bestimmen Sie die Qualität Ihres Fahrzeugs mittels KPIs.\n",
"Die Qualität des Fahrzeugs ist mit mindestens einem KPI je Qualitätsdimension (Aufwand, Verfügbarkeit, Akzeptanz) zu bestimmen. Enwickeln Sie zunächst sinnvolle KPIs, welche mit den gegebenen Daten umsetzbar sind. Halten Sie die Berechnungsvorschriften im Jupyter Notebook fest. Implementieren Sie deren Berechnung für das Gesamtsystem \"Fahrzeug\" mittels einzelner Funktionen im Skript `calculation_rules`. Sie können zusätzlich Ihre Methoden auch auf die niedrigeren Aggregationsebenen anwenden."
]
},
{
"cell_type": "markdown",
"id": "d5f02096",
"metadata": {},
"source": [
"Beschreiben Sie den jeweiligen KPI und geben Sie seine Berechnungsvorschrift an:"
]
},
{
"cell_type": "markdown",
"id": "a793bce8",
"metadata": {},
"source": [
"$$\n",
"a = \\frac{b}{c} + d\n",
"$$"
]
},
{
"cell_type": "markdown",
"id": "9a21b4ac",
"metadata": {},

Rivera Alcalde, Andrés Daniel
committed
"source": [
"1. Total delivery time\n",
"$$\n",
"T_{\\text{delivery}} = \\max_{i} \\left( T_i \\right)\n",
"$$"
]
},
{
"cell_type": "markdown",
"id": "e300a005",
"metadata": {},

Rivera Alcalde, Andrés Daniel
committed
"source": [
"2. Total CO2 emissions\n",
"$$\n",
"{CO2}_{\\text{total}} = \\sum_{i} \\left( \\text{environmental\\_impact}_i \\times \\text{mass}_i \\right)\n",
"$$\n",
"\n",
"3. Total price\n",
"$$\n",
"{Price}_{\\text{total}} = \\sum_{i} \\text{price}_i\n",
"$$"
]
},
{
"cell_type": "markdown",
"id": "2aad773a",
"metadata": {},
"source": [
"Halten Sie die berechneten Werte für die KPIs im Notebook\n",
"fest:"
]
},
"execution_count": 5,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"You called the test function.\n"
]
}
],
"# calculate the KPIs for your car\n",

Rivera Alcalde, Andrés Daniel
committed
"calculation_rules.test_function()\n",
"\n",
"total_delivery_time=calculation_rules.kpi_delivery_time(entire_auto_assembly)\n",
"\n",
"total_co2_emissions=calculation_rules.kpi_total_co2_emissions(entire_auto_assembly)\n",
"\n",
"total_price=calculation_rules.kpi_total_price(entire_auto_assembly)\n"
]
},
{
"cell_type": "code",
"execution_count": 6,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Total delivery time is: 13 Days\n",
"Total CO2 emissions are: 3273.303699999999 Grams\n",
"Total preis is: 32.941 Euro\n"
]
}
],

Rivera Alcalde, Andrés Daniel
committed
"# print your KPIs\n",
"\n",
"print(\"Total delivery time is: \", total_delivery_time, \"Days\")\n",
"print(\"Total CO2 emissions are: \", total_co2_emissions, \"Grams\")\n",
"print(\"Total preis is: \", total_price, \"Euro\")\n"
{
"cell_type": "markdown",
"id": "b89e8fb9",
"metadata": {},
"source": [
"Exportieren Sie schließlich Ihr entworfenes Fahrzeug inklusive der entwickelten KPIs:"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "d518275f",
"metadata": {},
"outputs": [],
"source": [
"# export car and its properties\n",
"\n",
"entire_auto_assembly.properties[\"delivery time [days]\"]=total_delivery_time\n",
"entire_auto_assembly.properties[\"environmental impact [kg CO2e /kg]\"]=total_co2_emissions\n",
"entire_auto_assembly.properties[\"price [Euro]\"]=total_price\n",
"\n",

Rivera Alcalde, Andrés Daniel
committed
"with open(\"entire_auto_assembly.json\", \"w\") as fp:\n",
" json.dump(entire_auto_assembly.to_dict(), fp, cls=KPIEncoder, indent=4)"
{
"cell_type": "markdown",
"id": "89c75440",
"metadata": {},
"source": [
{
"cell_type": "markdown",
"id": "f8a2e1b0",
"metadata": {},
"source": [
]
},
{
"cell_type": "markdown",
"id": "80407e7f",
"metadata": {},
"source": [
"Setzen Sie sich ein Ziel, welche Qualitätsdimensionen in einem zweiten Fahrzeug verbessert werden sollen und bauen\n",
"Sie darauf aufbauend ein zweites Fahrzeug aus den gegebenen LEGO-Teilen auf.\n",
"Die Anforderungen an das Fahrzeug sind identisch zum ersten. Wählen Sie die Einzelteile und deren Zusammenspiel entsprechend Ihrer Zielstellung aus."
]
},
{
"cell_type": "markdown",
"id": "f4c620ee",
"metadata": {},
"source": [
"Formulieren Sie ein Versuchsziel für diesen Versuch. Beschreiben Sie unter anderem, welche Verbesserung Sie vornehmen möchten:"
]
},
{
"cell_type": "markdown",
"id": "e3dc7e29",
"metadata": {},
"source": []
},
{
"cell_type": "markdown",
"id": "73c454f2",
"metadata": {},
"source": [
"cell_type": "markdown",
"id": "2b381a60",
"metadata": {},
"source": [
"Fügen Sie eine Abbildung des fertigen Autos in LeoCAD hinzu:"
]
},
{
"cell_type": "markdown",
"id": "2b6e7f12",
"metadata": {},
"source": [
""
]
},
{
"cell_type": "markdown",
"id": "23c19009",
"metadata": {},
"source": [
"Beschreiben Sie kurz und präzise den Aufbau des zweiten Fahrzeugs:"
]
},
{
"cell_type": "markdown",
"id": "a08bf9cf",
"metadata": {},
"source": []
},
{
"cell_type": "markdown",
"id": "14011b6f",
"Erstellen Sie das Fahrzeug in unserem Softwareframework:"
]
},
{
"cell_type": "code",
"execution_count": 8,
"outputs": [
{
"ename": "SyntaxError",
"evalue": "invalid syntax (4280980092.py, line 30)",
"output_type": "error",
"traceback": [
"\u001b[0;36m Cell \u001b[0;32mIn[8], line 30\u001b[0;36m\u001b[0m\n\u001b[0;31m axle_side_1.2 = LegoComponent(\"axle side 1.2\", axles_data[\"50451\"])\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
]
}
],

Rivera Alcalde, Andrés Daniel
committed
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
"# initialize components\n",
"\n",
"with open(\"datasheets/axles.json\") as json_file:\n",
" axles_data = json.load(json_file)\n",
"with open(\"datasheets/motors.json\") as json_file:\n",
" motors_data = json.load(json_file)\n",
"with open(\"datasheets/gears.json\") as json_file:\n",
" gears_data = json.load(json_file)\n",
"with open(\"datasheets/batteries.json\") as json_file:\n",
" batteries_data = json.load(json_file)\n",
"with open(\"datasheets/frame.json\") as json_file:\n",
" frame_data = json.load(json_file)\n",
"with open(\"datasheets/tires.json\") as json_file:\n",
" tires_data = json.load(json_file)\n",
"with open(\"datasheets/rims.json\") as json_file:\n",
" rims_data = json.load(json_file)\n",
"\n",
"\n",
"battery2 = LegoComponent(\"battery2\", batteries_data[\"8881-1\"])\n",
"\n",
"red_base = LegoComponent(\"red base\", frame_data[\"39790\"])\n",
"\n",
"motor2 = LegoComponent(\"motor2\", motors_data[\"88003-1\"])\n",
"\n",
"axle_input2 = LegoComponent(\"axle input\", axles_data[\"32073\"])\n",
"\n",
"antrieb_gear2 = LegoComponent(\"antrieb gear2\", gears_data[\"6589\"])\n",
"abtrieb_gear2 = LegoComponent(\"abtrieb gear2\", gears_data[\"6589\"])\n",
"\n",
"axle_side_1_2 = LegoComponent(\"axle side 1 2\", axles_data[\"50451\"])\n",
"axle_side_2_2 = LegoComponent(\"axle side 2 2\", axles_data[\"50451\"])\n",

Rivera Alcalde, Andrés Daniel
committed
"\n",
"tire_1_2 = LegoComponent(\"tire 1 2\", tires_data[\"6015\"])\n",
"tires2=[tire_1_2]\n",

Rivera Alcalde, Andrés Daniel
committed
"for i in range (2,5):\n",
" cloned_tire2=tire_1_2.clone(f\"tire_{i}_2\")\n",

Rivera Alcalde, Andrés Daniel
committed
" tires2.append(cloned_tire2)\n",
"\n",
"rim_1_2 = LegoComponent(\"rim 1 2\", rims_data[\"3482\"])\n",
"rims2=[rim_1_2]\n",

Rivera Alcalde, Andrés Daniel
committed
"for i in range (2,5):\n",
" cloned_rim2=rim_1_2.clone(f\"rim_{i}_2\")\n",

Rivera Alcalde, Andrés Daniel
committed
" rims2.append(cloned_rim2)\n",
"\n",
"technic_bush_1_2 = LegoComponent(\"technic bush 1 2\", frame_data[\"32123\"])\n",
"technic_bushes2=[technic_bush_1_2]\n",

Rivera Alcalde, Andrés Daniel
committed
"for i in range (2,5):\n",
" cloned_technic_bush2=technic_bush_1_2.clone(f\"technic_bush_{i}_2\")\n",

Rivera Alcalde, Andrés Daniel
committed
" technic_bushes2.append(cloned_technic_bush2)\n",
"\n",
"technic_pin_1_2=LegoComponent(\"technic pin 1 2\", frame_data[\"55615\"])\n",
"technic_pins2=[technic_pin_1_2]\n",

Rivera Alcalde, Andrés Daniel
committed
"for i in range (2,5):\n",
" cloned_technic_pin2=technic_pin_1_2.clone(f\"technic_pin_{i}_2\")\n",

Rivera Alcalde, Andrés Daniel
committed
" technic_pins2.append(cloned_technic_pin2)\n",
"\n",
"technic_long_pin1=LegoComponent(\"technic long pin1\", axles_data[\"32054\"])\n",
"technic_long_pin2=LegoComponent(\"technic long pin2\", axles_data[\"32054\"])"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "0b7336fb",
"metadata": {},
"outputs": [],
"source": [
"# set properties"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [

Rivera Alcalde, Andrés Daniel
committed
"# aggregate components\n",
"\n",
"wheels2 = []\n",
"\n",
"for i in range(4):\n",
" wheel2 = LegoAssembly(AggregationLayer.SUBASSEMBLY, f\"wheel_{i+1}.2\", assembly_method=\"join lego blocks\")\n",
" wheel2.add([rims2[i], tires2[i]])\n",
" wheels2.append(wheel2)\n",
"\n",
"antrieb_axle2=LegoAssembly(AggregationLayer.SUBASSEMBLY, \"antrieb axle2\")\n",
"antrieb_axle2.add([axle_side_1.2,abtrieb_gear2])\n",
"\n",
"\n",
"frame_axles2=LegoAssembly(AggregationLayer.SUBASSEMBLY, \"frame axles2\")\n",
"frame_axles2.add([green_base, axle_side_2.2, antrieb_axle2])\n",
"\n",
"\n",
"\n",