Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • philip.mahouttchi-hosseini/quality-kpi-final
  • boris.dasgupta/quality-kpi
  • hani.husseini/quality-kpi
  • tolga.guelec/quality-kpi
  • eva.schlott/quality-kpi
  • artashes.manukyan/quality-kpi
  • reinhart.tjahjadi/quality-kpi-reinhart-jason-tjahjadi
  • sotiris.giovannis/quality-kpi-giovanns
  • luis.gleich/quality-kpi
  • julius.damm/quality-kpi
  • gaganpreet.singh/quality-kpi
  • felix.fassler/aufgabe-1-felixf
  • benjamin.gross/quality-kpi
  • yixing.tao/quality-kpi-2024
  • louis.randa/quality-kpi
  • konstantinos.boiadjiev/quality-kpi
  • ammon.wuendisch/quality-kpi
  • tarish.kalra/quality-kpi
  • constantin.messingfeld/quality-kpi
  • manuel.kaster/quality-kpi
  • rafi.noordin/quality-kpi-rafinoordin
  • fst-tuda/public/lehre/quality-kpi
  • robert.schaefer1/quality-kpi
  • luca_tobias.nuecker/quality-kpi
  • calvin.weide/quality-kpi
  • maximilian.gross1/quality-kpi
  • christoph.froehlich/quality-kpi
  • young-min.kong/quality-kpi
  • thomas.gruber/quality-kpi
  • dennis.dibbern/quality-kpi
  • luca.sommer/quality-kpi
  • tushar.sharma/quality-kpi
  • philipp.schmidt2/quality-kpi
  • jakob.knoblach/quality-kpi
  • diogo.fernandes_costa/quality-kpi
  • zidane.buermann/quality-kpi
  • elias.rausch/quality-kpi
  • vincent.jestaedt/quality-kpi
  • santiago.ramirez_saldana/quality-kpi
  • jan.wech/quality-kpi
  • noah.michel1/lerneinheit-1-noah-michel
  • bastian.bickel/quality-kpi
  • linus.schuette/quality-kpi
  • henrik.buechs/quality-kpi
  • florian.weiss/quality-kpi
  • julie.kickstein/quality-kpi
  • paul.zuendel/quality-kpi
  • valentin.kaemmerer/quality-kpi
  • erwin.durasow/quality-kpi
  • david.buening/quality-kpi
  • keanu.engel/engel-keanu-auto
  • leo.mensler/quality-kpi
  • tahsin.ahmad/quality-kpi
  • moritz.roth/moritz-roth
  • jonathan.kollmann/quality-kpi
  • noah.waltmann/quality-kpi
  • daniel.burgos/quality-kpi
  • nilay.kuslugil/quality-kpi
  • yvan.ngoune/quality-kpi
  • eric.hahn/quality-kpi
  • andy.zheng/quality-kpi
  • junghyun.seo/quality-kpi
  • fabian.roesch1/quality-kpi
  • ole.quiring/quality-kpi
  • jonas.dietrich/quality-kpi
  • marius.stumpe/quality-kpi
  • maurizio.fell/quality-kpi
  • harry.kristanto/quality-kpi-prakdig-hk
  • paul.bobrinskoy/quality-kpi
  • vladimir.pascari/quality-kpi-vladimir-pascari
  • paul_konrad.braun/quality-kpi
  • leon.dawkins/quality-kpi
  • noel.schwibus/quality-kpi
  • bianca.beer/quality-kpi
  • pascal.pohlenz/quality-kpi
  • martin.cao/quality-kpi
  • malte.kramp/quality-kpi
  • jannik.hoffmann/quality-kpi
  • ishwor.kapri/quality-kpi
  • dhiraj.baral/quality-kpi
  • tobias.erdmann/quality-kpi
  • naveen.mohan/quality-kpi
  • filip.fetzer/quality-kpi
  • jakob.koch/quality-kpi
  • sascha.lamm/quality-kpi
  • lilly.laubenheimer/quality-kpi
  • amen.bouzouraa/quality-kpi
  • louis.senff/quality-kpi
  • francisco.flores/quality-kpi
  • benit.iberhysaj/quality-kpi
  • daniel.vratnjan/quality-kpi
  • henri.sprickmann/quality-kpi
  • tim.ostendorf/quality-kpi
  • maximilian.kopp1/lerneinheit-i-quality-kpi
  • zineb.karri/quality-kpi
  • bryan.lauren/quality-kpi
  • leon.herz/quality-kpi
  • zhibo.zhao/quality-kpi
  • samuel.neidert/quality-kpi
  • jiacheng.wang/quality-kpi
  • lucas.czarnecki/quality-kpi
  • lukas.ripp/quality-kpi
  • nikolai.brueckner/quality-kpi-nikolai-brueckner
  • niklas.ulmer/quality-kpi
  • lea_sophie.heering/quality-kpi
  • julia.kipp/quality-kpi
  • andres.rivera/quality-kpi
  • felix.meyners/quality-kpi
  • paul.sipp/quality-kpi
  • pascal.grym/quality-kpi
  • simon.peters/quality-kpi
  • justus.naewie/quality-kpi
  • alicia.sachs/quality-kpi
  • pascal.schraut/quality-kpi
  • jonas.dissinger/quality-kpi
  • mattheo.beyer/quality-kpi
  • adonay.johannes/quality-kpi
  • konrad.winkhaus/winkhaus-konrad-2809351-64-le-1
  • miko.boml/quality-kpi
  • bob.putz/quality-kpi
  • buesra.akkaya/quality-kpi
  • anton.littmann/quality-kpi
  • julian.volgmann/quality-kpi
  • soner.elbudak/quality-kpi
  • ilhan_mert.dumlupinar/quality-kpi
  • ibrahim.alsaleh/quality-kpi
  • amina.anizi/quality-kpi
  • Philipp.List/quality-kpi
  • greta.kirchhoff/quality-kpi
  • rowie.samuel/quality-kpi
130 results
Show changes
Commits on Source (40)
%% Cell type:markdown id:c9328cd1 tags:
# FAIRe Qualitäts-KPIs
Autor:
Datum:
%% Cell type:markdown id:1c5d41dc tags:
## Forschungsfrage
Formulieren Sie eine oder mehrere Forschungsfragen zu der Lerneinheit:
%% Cell type:markdown id:14e306b5 tags:
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 tags:
## Erstes Fahrzeug
%% Cell type:markdown id:531d890a tags:
### Versuchsziel
Formulieren Sie ein Versuchsziel für diesen ersten Versuch:
%% Cell type:markdown id:30ddd8dc tags:
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 tags:
### Versuchsaufbau
Bauen Sie ein erstes Fahrzeug aus den gegebenen LEGO-Teilen in der CAD-Software LeoCAD auf.
Hierbei gelten die folgenden Rahmenbedingungen:
- Das Fahrzeug muss aus Baugruppen, Bauteilen und Komponenten bestehen.
- Es muss mindestens vier Räder besitzen
- Es muss sich durch den elektrischen Antrieb fortbewegen können.
- Die Verwendung eines Getriebes zwischen Motor und Antriebsachse(n) ist verpflichtend.
- Die Farbe von mindestens einem Teil soll sich von der in LeoCAD hinterlegten Standardfarbe unterscheiden.
- Es sind nur die LEGO-Teile zu verwenden, welche sich in den JSON-Dateien bzw. in
der zur Verfügung gestellten Teilebibliothek befinden.
%% Cell type:markdown id:0ebba2d8 tags:
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*):
%% Cell type:markdown id:935c200c tags:
![Auto 1 von Versuchsaufbau](figures/Auto1.jpeg)
%% Cell type:markdown id:05a8eb21 tags:
Beschreiben Sie kurz und präzise Ihr Fahrzeug:
%% Cell type:markdown id:df7f1d01 tags:
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 tags:
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
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.
*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 id:690da270 tags:
``` python
import json
import pprint
from functions import calculation_rules
from functions.classes import *
```
%% Cell type:code id:ccaf3043 tags:
``` python
# initialize components
with open("datasheets/axles.json") as json_file:
axles_data = json.load(json_file)
with open("datasheets/motors.json") as json_file:
motors_data = json.load(json_file)
with open("datasheets/gears.json") as json_file:
gears_data = json.load(json_file)
with open("datasheets/batteries.json") as json_file:
batteries_data = json.load(json_file)
with open("datasheets/frame.json") as json_file:
frame_data = json.load(json_file)
with open("datasheets/tires.json") as json_file:
tires_data = json.load(json_file)
with open("datasheets/rims.json") as json_file:
rims_data = json.load(json_file)
battery = LegoComponent("battery", batteries_data["8881-1"])
green_base = LegoComponent("green base", frame_data["39790"])
motor = LegoComponent("Motor", motors_data["88003-1"])
axle_input = LegoComponent("axle input", axles_data["32073"])
antrieb_gear = LegoComponent("antrieb gear", gears_data["18575"])
abtrieb_gear = LegoComponent("abtrieb gear", gears_data["94925"])
axle_side_1 = LegoComponent("axle side 1", axles_data["50451"])
axles=[axle_side_1]
for i in range (2,4):
cloned_axle=axle_side_1.clone(f"axle_side_{i}")
axles.append(cloned_axle)
tire_1 = LegoComponent("tire 1", tires_data["30699"])
tires=[tire_1]
for i in range (2,5):
cloned_tire=tire_1.clone(f"tire_{i}")
tires.append(cloned_tire)
rim_1 = LegoComponent("rim 1", rims_data["56904"])
rims=[rim_1]
for i in range (2,5):
cloned_rim=rim_1.clone(f"rim_{i}")
rims.append(cloned_rim)
technic_bush_1 = LegoComponent("technic bush 1", frame_data["32123"])
technic_bushes=[technic_bush_1]
for i in range (2,7):
cloned_technic_bush=technic_bush_1.clone(f"technic_bush_{i}")
technic_bushes.append(cloned_technic_bush)
technic_pin_1=LegoComponent("technic pin 1", frame_data["55615"])
technic_pins=[technic_pin_1]
for i in range (2,7):
cloned_technic_pin=technic_pin_1.clone(f"technic_pin_{i}")
technic_pins.append(cloned_technic_pin)
```
%% Cell type:code id:36f981df tags:
``` python
# set properties
```
color = "Light Grey"
components_teile = [battery, green_base, motor, axle_input, antrieb_gear, abtrieb_gear] + axles + tires + rims + technic_bushes + technic_pins
for component in components_teile:
component.properties["color"] = color
for component in components_teile:
pprint.pprint(component.properties)
green_base.properties["color"] = "Green"
```
%% Output
{'category': 'battery',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?S=8881-1',
'delivery time [days]': 3,
'dimensions [cm]': '8,8 x 6,3 x 3,2',
'environmental impact [kg CO2e /kg]': 6.95,
'item description': 'Power Functions Battery Box',
'item number': '8881-1',
'label': 'battery',
'mass [g]': 179.4,
'output voltage [V]': 9,
'price [Euro]': 12,
'related items': '8882-1, 8883-1, 88003-1'}
{'category': 'frame',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=39790',
'delivery time [days]': 3,
'dimension [studs]': '11 x 15 x 1',
'environmental impact [kg CO2e /kg]': 11.93,
'item description': 'Technic, Liftarm, Modified Frame Thick 11 x 15 Open '
'Center',
'item number': 39790,
'label': 'green base',
'mass [g]': 12.96,
'price [Euro]': 2.19}
{'category': 'motor',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?S=88003-1',
'delivery time [days]': 3,
'dimensions [cm]': '13 x 11 x 2.5',
'environmental impact [kg CO2e /kg]': 15.84,
'idle current [mA]': 120,
'idle speed [rev per min]': 390,
'input voltage [V]': 9,
'item description': 'Power Functions L-Motor',
'item number': '88003-1',
'label': 'Motor',
'locking torque [Ncm]': 18,
'mass [g]': 48.0,
'price [Euro]': 15,
'related items': '8881-1'}
{'category': 'axle',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=32073',
'delivery time [days]': 3,
'dimension [studs]': 5,
'environmental impact [kg CO2e /kg]': 11.03,
'item description': 'Axle 5 studs',
'item number': 32073,
'label': 'axle input',
'mass [g]': 0.66,
'price [Euro]': 0.001}
{'category': 'gear',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=32269',
'delivery time [days]': 13,
'environmental impact [kg CO2e /kg]': 32.06,
'item description': 'Gear 20 Tooth Double Bevel',
'item number': 18575,
'label': 'antrieb gear',
'mass [g]': 1.4,
'price [Euro]': 0.36}
{'category': 'gear',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=94925',
'delivery time [days]': 12,
'environmental impact [kg CO2e /kg]': 32.06,
'item description': 'Gear 16 Tooth',
'item number': 94925,
'label': 'abtrieb gear',
'mass [g]': 0.7,
'price [Euro]': 0.2}
{'category': 'axle',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=50451',
'delivery time [days]': 3,
'dimension [studs]': 16,
'environmental impact [kg CO2e /kg]': 11.03,
'item description': 'Axle 16 studs',
'item number': 50451,
'label': 'axle side 1',
'mass [g]': 2.37,
'price [Euro]': 0.75}
{'category': 'axle',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=50451',
'delivery time [days]': 3,
'dimension [studs]': 16,
'environmental impact [kg CO2e /kg]': 11.03,
'item description': 'Axle 16 studs',
'item number': 50451,
'label': 'axle_side_2',
'mass [g]': 2.37,
'price [Euro]': 0.75}
{'category': 'axle',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=50451',
'delivery time [days]': 3,
'dimension [studs]': 16,
'environmental impact [kg CO2e /kg]': 11.03,
'item description': 'Axle 16 studs',
'item number': 50451,
'label': 'axle_side_3',
'mass [g]': 2.37,
'price [Euro]': 0.75}
{'category': 'tire',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=30699',
'delivery time [days]': 5,
'environmental impact [kg CO2e /kg]': 8.97,
'inner diameter [mm]': 30,
'item description': 'Tire 43.2 x 14 Solid',
'item number': 30699,
'label': 'tire 1',
'mass [g]': 8.25,
'outer diameter [mm]': 43.2,
'price [Euro]': 0.06,
'related items': 56904}
{'category': 'tire',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=30699',
'delivery time [days]': 5,
'environmental impact [kg CO2e /kg]': 8.97,
'inner diameter [mm]': 30,
'item description': 'Tire 43.2 x 14 Solid',
'item number': 30699,
'label': 'tire_2',
'mass [g]': 8.25,
'outer diameter [mm]': 43.2,
'price [Euro]': 0.06,
'related items': 56904}
{'category': 'tire',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=30699',
'delivery time [days]': 5,
'environmental impact [kg CO2e /kg]': 8.97,
'inner diameter [mm]': 30,
'item description': 'Tire 43.2 x 14 Solid',
'item number': 30699,
'label': 'tire_3',
'mass [g]': 8.25,
'outer diameter [mm]': 43.2,
'price [Euro]': 0.06,
'related items': 56904}
{'category': 'tire',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=30699',
'delivery time [days]': 5,
'environmental impact [kg CO2e /kg]': 8.97,
'inner diameter [mm]': 30,
'item description': 'Tire 43.2 x 14 Solid',
'item number': 30699,
'label': 'tire_4',
'mass [g]': 8.25,
'outer diameter [mm]': 43.2,
'price [Euro]': 0.06,
'related items': 56904}
{'category': 'rim',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=56904',
'delivery time [days]': 5,
'diameter [mm]': 30.0,
'environmental impact [kg CO2e /kg]': 32.06,
'item description': 'Wheel 30mm D. x 14mm',
'item number': 56904,
'label': 'rim 1',
'mass [g]': 4.1,
'price [Euro]': 0.01,
'related items': 30699}
{'category': 'rim',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=56904',
'delivery time [days]': 5,
'diameter [mm]': 30.0,
'environmental impact [kg CO2e /kg]': 32.06,
'item description': 'Wheel 30mm D. x 14mm',
'item number': 56904,
'label': 'rim_2',
'mass [g]': 4.1,
'price [Euro]': 0.01,
'related items': 30699}
{'category': 'rim',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=56904',
'delivery time [days]': 5,
'diameter [mm]': 30.0,
'environmental impact [kg CO2e /kg]': 32.06,
'item description': 'Wheel 30mm D. x 14mm',
'item number': 56904,
'label': 'rim_3',
'mass [g]': 4.1,
'price [Euro]': 0.01,
'related items': 30699}
{'category': 'rim',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=56904',
'delivery time [days]': 5,
'diameter [mm]': 30.0,
'environmental impact [kg CO2e /kg]': 32.06,
'item description': 'Wheel 30mm D. x 14mm',
'item number': 56904,
'label': 'rim_4',
'mass [g]': 4.1,
'price [Euro]': 0.01,
'related items': 30699}
{'category': 'frame',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=4265c',
'delivery time [days]': 3,
'dimension [studs]': 1,
'environmental impact [kg CO2e /kg]': 11.93,
'item description': 'Technic Bush 1/2 Smooth',
'item number': 32123,
'label': 'technic bush 1',
'mass [g]': 0.01,
'price [Euro]': 0.01}
{'category': 'frame',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=4265c',
'delivery time [days]': 3,
'dimension [studs]': 1,
'environmental impact [kg CO2e /kg]': 11.93,
'item description': 'Technic Bush 1/2 Smooth',
'item number': 32123,
'label': 'technic_bush_2',
'mass [g]': 0.01,
'price [Euro]': 0.01}
{'category': 'frame',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=4265c',
'delivery time [days]': 3,
'dimension [studs]': 1,
'environmental impact [kg CO2e /kg]': 11.93,
'item description': 'Technic Bush 1/2 Smooth',
'item number': 32123,
'label': 'technic_bush_3',
'mass [g]': 0.01,
'price [Euro]': 0.01}
{'category': 'frame',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=4265c',
'delivery time [days]': 3,
'dimension [studs]': 1,
'environmental impact [kg CO2e /kg]': 11.93,
'item description': 'Technic Bush 1/2 Smooth',
'item number': 32123,
'label': 'technic_bush_4',
'mass [g]': 0.01,
'price [Euro]': 0.01}
{'category': 'frame',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=4265c',
'delivery time [days]': 3,
'dimension [studs]': 1,
'environmental impact [kg CO2e /kg]': 11.93,
'item description': 'Technic Bush 1/2 Smooth',
'item number': 32123,
'label': 'technic_bush_5',
'mass [g]': 0.01,
'price [Euro]': 0.01}
{'category': 'frame',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=4265c',
'delivery time [days]': 3,
'dimension [studs]': 1,
'environmental impact [kg CO2e /kg]': 11.93,
'item description': 'Technic Bush 1/2 Smooth',
'item number': 32123,
'label': 'technic_bush_6',
'mass [g]': 0.01,
'price [Euro]': 0.01}
{'category': 'frame',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=55615',
'delivery time [days]': 5,
'dimension [studs]': '4 x 4 x 1',
'environmental impact [kg CO2e /kg]': 11.93,
'item description': 'Technic, Pin Connector Perpendicular 3 x 3 Bent with 4 '
'Pins',
'item number': 55615,
'label': 'technic pin 1',
'mass [g]': 1.9,
'price [Euro]': 0.1}
{'category': 'frame',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=55615',
'delivery time [days]': 5,
'dimension [studs]': '4 x 4 x 1',
'environmental impact [kg CO2e /kg]': 11.93,
'item description': 'Technic, Pin Connector Perpendicular 3 x 3 Bent with 4 '
'Pins',
'item number': 55615,
'label': 'technic_pin_2',
'mass [g]': 1.9,
'price [Euro]': 0.1}
{'category': 'frame',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=55615',
'delivery time [days]': 5,
'dimension [studs]': '4 x 4 x 1',
'environmental impact [kg CO2e /kg]': 11.93,
'item description': 'Technic, Pin Connector Perpendicular 3 x 3 Bent with 4 '
'Pins',
'item number': 55615,
'label': 'technic_pin_3',
'mass [g]': 1.9,
'price [Euro]': 0.1}
{'category': 'frame',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=55615',
'delivery time [days]': 5,
'dimension [studs]': '4 x 4 x 1',
'environmental impact [kg CO2e /kg]': 11.93,
'item description': 'Technic, Pin Connector Perpendicular 3 x 3 Bent with 4 '
'Pins',
'item number': 55615,
'label': 'technic_pin_4',
'mass [g]': 1.9,
'price [Euro]': 0.1}
{'category': 'frame',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=55615',
'delivery time [days]': 5,
'dimension [studs]': '4 x 4 x 1',
'environmental impact [kg CO2e /kg]': 11.93,
'item description': 'Technic, Pin Connector Perpendicular 3 x 3 Bent with 4 '
'Pins',
'item number': 55615,
'label': 'technic_pin_5',
'mass [g]': 1.9,
'price [Euro]': 0.1}
{'category': 'frame',
'color': 'Light Grey',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=55615',
'delivery time [days]': 5,
'dimension [studs]': '4 x 4 x 1',
'environmental impact [kg CO2e /kg]': 11.93,
'item description': 'Technic, Pin Connector Perpendicular 3 x 3 Bent with 4 '
'Pins',
'item number': 55615,
'label': 'technic_pin_6',
'mass [g]': 1.9,
'price [Euro]': 0.1}
%% Cell type:code id:da2d141c tags:
``` python
# aggregate components
```
wheels = []
for i in range(4):
wheel = LegoAssembly(AggregationLayer.SUBASSEMBLY, f"wheel_{i+1}", assembly_method="join lego blocks")
wheel.add([rims[i], tires[i]])
wheels.append(wheel)
antrieb_axle=LegoAssembly(AggregationLayer.SUBASSEMBLY, "antrieb axle")
antrieb_axle.add([axles[2],abtrieb_gear])
frame_axles=LegoAssembly(AggregationLayer.SUBASSEMBLY, "frame axles")
frame_axles.add([green_base, axles[0], axles[1], antrieb_axle])
entire_drive_motor=LegoAssembly(AggregationLayer.SUBASSEMBLY, "entire drive motor")
entire_drive_motor.add([motor, axle_input,antrieb_gear])
pinned_battery=LegoAssembly(AggregationLayer.SUBASSEMBLY, "pinned battery")
pinned_battery.add([battery, technic_pins[0],technic_pins[1],technic_pins[2],technic_pins[3]])
entire_pinned_motor=LegoAssembly(AggregationLayer.ASSEMBLY, "pinned motor")
entire_pinned_motor.add([entire_drive_motor, technic_pins[4],technic_pins[5]])
entire_auto_assembly=LegoAssembly(AggregationLayer.SYSTEM, "entire auto assembly")
entire_auto_assembly.add([frame_axles,wheels[0],technic_bushes[0],wheels[1],technic_bushes[1],wheels[2],technic_bushes[2],wheels[3],
technic_bushes[3], technic_bushes[4], technic_bushes[5], pinned_battery, entire_pinned_motor])
print_assembly_tree(entire_auto_assembly)
```
%% Output
LegoAssembly entire auto assembly [71608ee6-415d-4851-ad9f-d6b9879f86b4]
├── LegoAssembly frame axles [30dfb0c7-60e7-47e8-ac01-d0ecf55387ba]
│ ├── LegoAssembly antrieb axle [a7661587-84fe-4465-b8c2-29fd8f58f145]
│ │ ├── LegoComponent axle_side_3 [87cdfed7-e08a-41ab-adc3-c273985f2f29]
│ │ └── LegoComponent abtrieb gear [d6bf0ec0-2978-4b25-aa3e-4e7818b9cdf3]
│ ├── LegoComponent green base [a21a5f3e-e49c-42c3-8a31-238167acd651]
│ ├── LegoComponent axle side 1 [836426db-fcc4-4b30-ac91-b898a78c446e]
│ └── LegoComponent axle_side_2 [b85d2086-5beb-4126-88d8-44d69df36b39]
├── LegoAssembly wheel_1 [1e711913-1182-444c-b80b-11d85392cc1e]
│ ├── LegoComponent rim 1 [9bbce185-f5db-44d2-9631-d7aae761fecd]
│ └── LegoComponent tire 1 [da849bf2-acfb-44fb-aaae-fc68930ef354]
├── LegoAssembly wheel_2 [9c51aaa7-b8c3-44b2-b3b8-16122bd1267f]
│ ├── LegoComponent rim_2 [38df41cd-de8d-4642-b552-aac77bd5e640]
│ └── LegoComponent tire_2 [f6bf40b1-1146-4f21-a206-313068bbfaf8]
├── LegoAssembly wheel_3 [68d17e92-8050-4872-91ae-7847b37a12b7]
│ ├── LegoComponent rim_3 [0aa155e1-e6a8-4235-9a0e-ae0f0f6166bd]
│ └── LegoComponent tire_3 [46929c5c-18ee-4c8c-826f-69dc306a9418]
├── LegoAssembly wheel_4 [4d1797f1-66d0-4c12-802c-f6f4fe1b0dab]
│ ├── LegoComponent rim_4 [9a052238-f199-414f-ac9e-1627ff038824]
│ └── LegoComponent tire_4 [0c898ea5-554e-4f23-aad7-ab9989e1eaf2]
├── LegoAssembly pinned battery [726a0c4e-96dd-4967-9542-a36875685d58]
│ ├── LegoComponent battery [a5051f9e-3c14-4b50-a5a3-91c9361e3c3f]
│ ├── LegoComponent technic pin 1 [3d511e5b-4675-4376-9618-d347aadc3c92]
│ ├── LegoComponent technic_pin_2 [a91c24f0-02c9-486f-9500-338c5038c300]
│ ├── LegoComponent technic_pin_3 [1d4c073b-a695-413c-9b2c-e85b185a0d3e]
│ └── LegoComponent technic_pin_4 [2fbc474a-96a6-42d7-909b-c1442ab525c5]
├── LegoAssembly pinned motor [d9902053-d18d-4189-ad49-08939e5ad48d]
│ ├── LegoAssembly entire drive motor [5c531fca-0717-43b1-aa1d-c17587a4fc0e]
│ │ ├── LegoComponent Motor [4a5c244e-1b02-4d9b-b6dd-d74e9960d82a]
│ │ ├── LegoComponent axle input [54252eeb-2bde-46de-a87f-7a7b154fcc28]
│ │ └── LegoComponent antrieb gear [94571922-3f17-477f-a391-30f0d091d6d1]
│ ├── LegoComponent technic_pin_5 [5d1276a2-7127-453e-a97a-0fbea9f03ae2]
│ └── LegoComponent technic_pin_6 [94f79dab-0592-4317-98e1-0f1a2ff4d1ca]
├── LegoComponent technic bush 1 [20b66721-e11f-4380-b96d-9ab8a9e8c543]
├── LegoComponent technic_bush_2 [6807244f-4387-46bd-ad51-75e00f6b0fcf]
├── LegoComponent technic_bush_3 [d6f480c5-cdd7-4881-9438-a3677775a736]
├── LegoComponent technic_bush_4 [4859d471-40b0-491c-a1dc-61d76379003e]
├── LegoComponent technic_bush_5 [af16cd9c-e487-475a-8bf1-84bd24449d7c]
└── LegoComponent technic_bush_6 [82bc5d6c-20eb-483c-aa4f-f80708efe592]
%% Cell type:markdown id:c1fef7f0 tags:
### Analyse
Bestimmen Sie die Qualität Ihres Fahrzeugs mittels KPIs.
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 tags:
Beschreiben Sie den jeweiligen KPI und geben Sie seine Berechnungsvorschrift an:
%% Cell type:markdown id:a793bce8 tags:
$$
a = \frac{b}{c} + d
$$
%% Cell type:markdown id:9a21b4ac tags:
1. Total delivery time
$$
T_{\text{delivery}} = \max_{i} \left( T_i \right)
$$
%% Cell type:markdown id:e300a005 tags:
2. Total CO2 emissions
$$
{CO2}_{\text{total}} = \sum_{i} \left( \text{environmental\_impact}_i \times \text{mass}_i \right)
$$
3. Total price
$$
{Price}_{\text{total}} = \sum_{i} \text{price}_i
$$
%% Cell type:markdown id:2aad773a tags:
Halten Sie die berechneten Werte für die KPIs im Notebook
fest:
%% Cell type:code id:59eabafc tags:
``` python
# calculate the KPIs for your car
calculation_rules.test_function()
total_delivery_time=calculation_rules.kpi_delivery_time(entire_auto_assembly)
total_co2_emissions=calculation_rules.kpi_total_co2_emissions(entire_auto_assembly)
total_price=calculation_rules.kpi_total_price(entire_auto_assembly)
```
%% Output
You called the test function.
%% Cell type:code id:c774b381 tags:
``` python
# print your KPIs
print("Total delivery time is: ", total_delivery_time, "Days")
print("Total CO2 emissions are: ", total_co2_emissions, "Kilograms")
print("Total preis is: ", total_price, "Euro")
```
%% Output
Total delivery time is: 13 Days
Total CO2 emissions are: 3.273303700000002 Grams
Total preis is: 32.941 Euro
%% Cell type:markdown id:b89e8fb9 tags:
Exportieren Sie schließlich Ihr entworfenes Fahrzeug inklusive der entwickelten KPIs:
%% Cell type:code id:d518275f tags:
``` python
# export car and its properties
entire_auto_assembly.properties["delivery time [days]"]=total_delivery_time
entire_auto_assembly.properties["environmental impact [kg CO2e /kg]"]=total_co2_emissions
entire_auto_assembly.properties["price [Euro]"]=total_price
with open("entire_auto_assembly.json", "w") as fp:
json.dump(entire_auto_assembly.to_dict(), fp, cls=KPIEncoder, indent=4)
```
%% Cell type:markdown id:89c75440 tags:
## Zweites Fahrzeug
%% Cell type:markdown id:f8a2e1b0 tags:
### Versuchsziel
%% Cell type:markdown id:80407e7f tags:
Setzen Sie sich ein Ziel, welche Qualitätsdimensionen in einem zweiten Fahrzeug verbessert werden sollen und bauen
Sie darauf aufbauend ein zweites Fahrzeug aus den gegebenen LEGO-Teilen auf.
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 tags:
Formulieren Sie ein Versuchsziel für diesen Versuch. Beschreiben Sie unter anderem, welche Verbesserung Sie vornehmen möchten:
%% Cell type:markdown id:e3dc7e29 tags:
%% Cell type:markdown id:73c454f2 tags:
### Versuchsaufbau
%% Cell type:markdown id:2b381a60 tags:
Fügen Sie eine Abbildung des fertigen Autos in LeoCAD hinzu:
%% Cell type:markdown id:2b6e7f12 tags:
![Auto 2 von Versuchsaufbau](figures/Auto2.jpeg)
%% Cell type:markdown id:23c19009 tags:
Beschreiben Sie kurz und präzise den Aufbau des zweiten Fahrzeugs:
%% Cell type:markdown id:a08bf9cf tags:
%% Cell type:markdown id:14011b6f tags:
Erstellen Sie das Fahrzeug in unserem Softwareframework:
%% Cell type:code id:c35de753 tags:
``` python
# initialize components
with open("datasheets/axles.json") as json_file:
axles_data = json.load(json_file)
with open("datasheets/motors.json") as json_file:
motors_data = json.load(json_file)
with open("datasheets/gears.json") as json_file:
gears_data = json.load(json_file)
with open("datasheets/batteries.json") as json_file:
batteries_data = json.load(json_file)
with open("datasheets/frame.json") as json_file:
frame_data = json.load(json_file)
with open("datasheets/tires.json") as json_file:
tires_data = json.load(json_file)
with open("datasheets/rims.json") as json_file:
rims_data = json.load(json_file)
battery2 = LegoComponent("battery2", batteries_data["8881-1"])
red_base = LegoComponent("red base", frame_data["39790"])
motor2 = LegoComponent("motor2", motors_data["88003-1"])
axle_input2 = LegoComponent("axle input", axles_data["32073"])
antrieb_gear2 = LegoComponent("antrieb gear2", gears_data["6589"])
abtrieb_gear2 = LegoComponent("abtrieb gear2", gears_data["6589"])
axle_side_1_2 = LegoComponent("axle side 1 2", axles_data["50451"])
axle_side_2_2 = LegoComponent("axle side 2 2", axles_data["50451"])
tire_1_2 = LegoComponent("tire 1 2", tires_data["6015"])
tires2=[tire_1_2]
for i in range (2,5):
cloned_tire2=tire_1_2.clone(f"tire_{i}_2")
tires2.append(cloned_tire2)
rim_1_2 = LegoComponent("rim 1 2", rims_data["3482"])
rims2=[rim_1_2]
for i in range (2,5):
cloned_rim2=rim_1_2.clone(f"rim_{i}_2")
rims2.append(cloned_rim2)
technic_bush_1_2 = LegoComponent("technic bush 1 2", frame_data["32123"])
technic_bushes2=[technic_bush_1_2]
for i in range (2,5):
cloned_technic_bush2=technic_bush_1_2.clone(f"technic_bush_{i}_2")
technic_bushes2.append(cloned_technic_bush2)
technic_pin_1_2=LegoComponent("technic pin 1 2", frame_data["55615"])
technic_pins2=[technic_pin_1_2]
for i in range (2,5):
cloned_technic_pin2=technic_pin_1_2.clone(f"technic_pin_{i}_2")
technic_pins2.append(cloned_technic_pin2)
technic_long_pin1=LegoComponent("technic long pin1", frame_data["32054"])
technic_long_pin2=LegoComponent("technic long pin2", frame_data["32054"])
```
%% Cell type:code id:0b7336fb tags:
``` python
# set properties
```
%% Cell type:code id:fb445ea0 tags:
``` python
# aggregate components
```
wheels2 = []
for i in range(4):
wheel2 = LegoAssembly(AggregationLayer.SUBASSEMBLY, f"wheel_{i+1}_2", assembly_method="join lego blocks")
wheel2.add([rims2[i], tires2[i]])
wheels2.append(wheel2)
antrieb_axle2=LegoAssembly(AggregationLayer.SUBASSEMBLY, "antrieb axle2")
antrieb_axle2.add([axle_side_1_2,abtrieb_gear2])
frame_axles2=LegoAssembly(AggregationLayer.SUBASSEMBLY, "frame axles2")
frame_axles2.add([green_base, axle_side_2_2, antrieb_axle2])
entire_drive_motor2=LegoAssembly(AggregationLayer.SUBASSEMBLY, "entire drive motor2")
entire_drive_motor2.add([motor2, axle_input2,antrieb_gear2])
pinned_battery2=LegoAssembly(AggregationLayer.SUBASSEMBLY, "pinned battery2")
pinned_battery2.add([battery2, technic_pins2[0],technic_pins2[1],technic_pins2[2],technic_pins2[3]])
entire_auto_assembly2=LegoAssembly(AggregationLayer.SYSTEM, "entire auto assembly2")
entire_auto_assembly2.add([frame_axles2,wheels2[0],technic_bushes2[0],wheels2[1],technic_bushes2[1],wheels2[2],technic_bushes2[2],wheels2[3],
technic_bushes2[3], pinned_battery2, entire_drive_motor2,technic_long_pin1,technic_long_pin2])
print_assembly_tree(entire_auto_assembly2)
```
%% Output
LegoAssembly entire auto assembly2 [a13bca19-2704-4e4a-9122-1bad706d29c1]
├── LegoAssembly frame axles2 [1be2c3f9-481d-4301-b0a1-4076f4acccd2]
│ ├── LegoAssembly antrieb axle2 [628c06e2-66b1-499c-b264-c01fbb4464c5]
│ │ ├── LegoComponent axle side 1 2 [a03d28c9-448a-45d8-bc26-c2b028f6e63e]
│ │ └── LegoComponent abtrieb gear2 [f0994819-9661-440d-beb0-78821a21ac62]
│ ├── LegoComponent green base [a21a5f3e-e49c-42c3-8a31-238167acd651]
│ └── LegoComponent axle side 2 2 [de1d05c0-cded-4042-befa-1ba81fc90e29]
├── LegoAssembly wheel_1_2 [ae1accff-60d8-445f-818e-206deb592846]
│ ├── LegoComponent rim 1 2 [f3875870-d4d3-48f8-828e-ce5cec255ad8]
│ └── LegoComponent tire 1 2 [578b6a13-0ff0-4397-aa25-08bf26a999d2]
├── LegoAssembly wheel_2_2 [b9ff3e0b-b2b1-4460-8a5f-95c3053ee39b]
│ ├── LegoComponent rim_2_2 [286d8a34-fe8d-4cd4-8802-d743f1b755fb]
│ └── LegoComponent tire_2_2 [c851bc4d-e5c4-403e-a277-71ae8af91870]
├── LegoAssembly wheel_3_2 [36c6ee7f-3f94-46cd-94c9-5add2de56d03]
│ ├── LegoComponent rim_3_2 [da19cffb-1bd8-4b57-b3c3-9271f8aec91c]
│ └── LegoComponent tire_3_2 [14743d8a-e0d8-42a7-ba27-fbc342da84c2]
├── LegoAssembly wheel_4_2 [0930c037-c45d-43d1-b0bf-5e8f6f2e2577]
│ ├── LegoComponent rim_4_2 [87b5490e-b09b-4faa-b10c-757b0e80bcb8]
│ └── LegoComponent tire_4_2 [9c79e4d0-119a-42b9-9503-c2815b2b7bbc]
├── LegoAssembly pinned battery2 [993d156d-3c2b-4838-934b-eb76b1926f5c]
│ ├── LegoComponent battery2 [9b958332-1690-4ecc-a0d8-3bbad56f750f]
│ ├── LegoComponent technic pin 1 2 [e5b38978-9169-4cfa-9a22-ebba6d48bfb5]
│ ├── LegoComponent technic_pin_2_2 [6a057b7f-3e67-4bbd-9f8a-95b4112fe290]
│ ├── LegoComponent technic_pin_3_2 [13dbea29-2162-4065-8387-4ebeabd0c1b4]
│ └── LegoComponent technic_pin_4_2 [a95ffa8b-80c3-42ee-a8c6-104806e2db6a]
├── LegoAssembly entire drive motor2 [66deb79a-b65d-4576-92f4-441411b98388]
│ ├── LegoComponent motor2 [aaf04496-37ab-4962-b4f9-516148001a76]
│ ├── LegoComponent axle input [d5d54f04-4339-4b7a-8a46-2b179427450c]
│ └── LegoComponent antrieb gear2 [1b7f71be-9c26-4ba4-bb5a-0ea8311ab5a7]
├── LegoComponent technic bush 1 2 [08de8521-f809-4a40-bb42-4970f5a6d3c1]
├── LegoComponent technic_bush_2_2 [15a8598d-e828-4ebc-944c-fc8fd5001ab1]
├── LegoComponent technic_bush_3_2 [b86d490b-5cba-4df5-ade9-a8381cb6db99]
├── LegoComponent technic_bush_4_2 [0e5ebe56-f77f-4dd1-ac5e-331934a8d8bc]
├── LegoComponent technic long pin1 [fced9863-5fe8-4e77-8524-dfe14f9739f2]
└── LegoComponent technic long pin2 [e5cff6c2-b80e-4448-8f8e-bf3e399632b6]
%% Cell type:markdown id:89e54480 tags:
### Analyse
Bestimmen Sie die KPIs des zweiten Fahrzeugs
%% Cell type:code id:762a1e93 tags:
``` python
# calculate the KPIs for your car
calculation_rules.test_function()
total_delivery_time2=calculation_rules.kpi_delivery_time(entire_auto_assembly2)
total_co2_emissions2=calculation_rules.kpi_total_co2_emissions(entire_auto_assembly2)
total_price2=calculation_rules.kpi_total_price(entire_auto_assembly2)
```
%% Output
You called the test function.
%% Cell type:code id:1ed67328 tags:
``` python
# print your KPIs
print("Total delivery time is: ", total_delivery_time2, "Days")
print("Total CO2 emissions are: ", total_co2_emissions2, "Kilograms")
print("Total preis is: ", total_price2, "Euro")
```
%% Output
Total delivery time is: 12 Days
Total CO2 emissions are: 2.5235498 Grams
Total preis is: 31.212600000000005 Euro
%% Cell type:markdown id:0f11b370 tags:
Exportieren Sie Ihr Fahrzeug inklusive der KPIs:
%% Cell type:code id:05d9d6f7 tags:
``` python
# export car and its properties
entire_auto_assembly2.properties["delivery time [days]"]=total_delivery_time2
entire_auto_assembly2.properties["environmental impact [kg CO2e /kg]"]=total_co2_emissions2
entire_auto_assembly2.properties["price [Euro]"]=total_price2
with open("entire_auto_assembly2.json", "w") as fp:
json.dump(entire_auto_assembly2.to_dict(), fp, cls=KPIEncoder, indent=4)
```
%% Cell type:markdown id:e413cd84 tags:
## Diskussion
### Ergebnisse
Stellen Sie die entwickelten KPIs beider Fahrzeuge gegenüber und wählen Sie hierfür unter anderem eine geeignete
grafische Darstellung. Stellen Sie dabei insbesondere sicher, dass die Datengrundlage ersichtlich ist. Halten Sie
auch die Plotbefehle im Notebook fest:
%% Cell type:code id:b0f93e22 tags:
``` python
# plot the data, save diagramm as svg-file
import pandas as pd
import matplotlib.pyplot as plt
data_autos = {
'KPIs': ['Total Delivery Time [Days]', 'Total CO2 Emissions [kg]', 'Price [Euro]'],
'Auto 1': [13, 3.27, 32.94],
'Auto 2': [12, 2.52, 31.21]
}
data_frame = pd.DataFrame(data_autos)
label_diagramm = data_frame['KPIs']
Auto_1_data = data_frame['Auto 1']
Auto_2_data = data_frame['Auto 2']
fig, ax = plt.subplots(figsize=(10, 6))
x = range(len(label_diagramm))
width = 0.45
ax.bar(x, Auto_1_data, width=width, label='Auto 1', color='green')
ax.bar([p + width for p in x], Auto_2_data, width=width, label='Auto 2', color='yellow')
ax.set_title('KPIs beider Autos')
ax.set_xlabel('KPIs')
ax.set_ylabel('Werte')
ax.set_xticks([p + width / 2 for p in x])
ax.set_xticklabels(label_diagramm)
ax.legend()
fig.savefig("kpis_autos.svg", format="svg")
plt.show()
```
%% Output
%% Cell type:markdown id:6044de27 tags:
Interpretieren Sie Ihre Ergebnisse. Vergleichen Sie die KPIs Ihrer Autos. Konnten Sie Ihre gewünschte Verbesserung erzielen? Welche Schlüsse ziehen Sie aus den Ergebnissen für die Qualität der beiden
Fahrzeuge?
%% Cell type:markdown id:0ca884b1 tags:
%% Cell type:markdown id:4f117169 tags:
Diskutieren Sie, inwieweit Ihre entwickelten KPIs die im Skript erläuterten FAIR-Prinzipien erfüllen:
%% Cell type:markdown id:f8ed82d2 tags:
%% Cell type:markdown id:bfed164a tags:
## Fazit
%% Cell type:markdown id:5d440f87 tags:
Ziehen Sie ein persönliches Fazit. Was haben Sie Neues gelernt?
%% Cell type:markdown id:b4151784 tags:
......
......@@ -33,6 +33,90 @@ def kpi_mass(system: LegoAssembly)->float:
# Add new functions for calculating metrics
def kpi_delivery_time(system: LegoAssembly)->float:
"""
Calculates the total delivery time of the system
Args:
system(LegoAssembly): LegoAssembly object that represents the system
Returns:
total_delivery_time (float): The amount of time of all components of the system it takes to arrive
Raises:
TypeError: If an argument with unsupported type is passed
(i.e. anything other than LegoAssembly).
"""
if not isinstance(system, LegoAssembly):
raise TypeError(f"Unsupported type {type(system)} passed to kpi_delivery_time()")
total_delivery_time=max(c.properties['delivery time [days]'] for c in system.get_component_list(-1))
return total_delivery_time
def kpi_total_co2_emissions(system: LegoAssembly) -> float:
"""
Calculates the total mass of CO2 emitted in the production of the system.
Args:
system (LegoAssembly): LegoAssembly object that represents the system
Returns:
total_co2_emissions (float): Sum of all CO2 emitted in the production of the system
Raises:
TypeError: If an argument with unsupported type is passed
(i.e. anything other than LegoAssembly).
"""
if not isinstance(system, LegoAssembly):
raise TypeError(f"Unsupported type {type(system)} passed to kpi_total_co2_emissions()")
total_co2_emissions = sum(
(c.properties["environmental impact [kg CO2e /kg]"] * (c.properties["mass [g]"])) / 1000
for c in system.get_component_list(-1)
)
return total_co2_emissions
def kpi_total_price(system: LegoAssembly) -> float:
"""
Calculates the total price of the system.
Args:
system (LegoAssembly): LegoAssembly object that represents the system
Returns:
total_price (float): Sum of prices of all component prices of the system
Raises:
TypeError: If an argument with unsupported type is passed
(i.e. anything other than LegoAssembly).
"""
if not isinstance(system, LegoAssembly):
raise TypeError(f"Unsupported type {type(system)} passed to kpi_total_price()")
total_price = sum(c.properties["price [Euro]"] for c in system.get_component_list(-1))
return total_price
if __name__ == "__main__":
"""
Function to inform that functions in this module is
......@@ -42,3 +126,5 @@ if __name__ == "__main__":
"This script contains functions for calculating the FAIR Quality KPIs."
"It is not to be executed independently."
)