| Total Complexity | 2 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | from kerapu.boom.attribuut.Attribuut import Attribuut |
||
| 2 | from kerapu.boom.attribuut_groep_koppeling.AttribuutGroepKoppeling import AttribuutGroepKoppeling |
||
| 3 | from kerapu.lbz.Subtraject import Subtraject |
||
| 4 | 1 | ||
| 5 | 1 | ||
| 6 | 1 | class AttribuutGroepKoppeling2(AttribuutGroepKoppeling): |
|
| 7 | """ |
||
| 8 | Klasse voor attribuutgroepkoppelingen met filtertoetswijze 2 (tussen onder- en bovengrens). |
||
| 9 | 1 | """ |
|
| 10 | |||
| 11 | # ------------------------------------------------------------------------------------------------------------------ |
||
| 12 | def __init__(self, |
||
| 13 | attribute_groep_id: int, |
||
| 14 | attribuut: Attribuut, |
||
| 15 | 1 | onder_toets_waarde: int, |
|
| 16 | boven_toets_waarde: int): |
||
| 17 | """ |
||
| 18 | Object constructor. |
||
| 19 | |||
| 20 | :param int attribute_groep_id: Het ID van deze koppeling. |
||
| 21 | :param Attribuut attribuut: Het attribuut van deze koppeling. |
||
| 22 | :param int onder_toets_waarde: De ondergrens. |
||
| 23 | :param int boven_toets_waarde: De bovengrens. |
||
| 24 | """ |
||
| 25 | AttribuutGroepKoppeling.__init__(self, attribute_groep_id, attribuut) |
||
| 26 | |||
| 27 | self._onder_toets_waarde: int = onder_toets_waarde |
||
| 28 | 1 | """ |
|
| 29 | De ondergrens om deze koppeling the laten vuren. |
||
| 30 | 1 | """ |
|
| 31 | |||
| 32 | self._boven_toets_waarde: int = boven_toets_waarde |
||
| 33 | """ |
||
| 34 | De bovengrens om deze koppeling the laten vuren. |
||
| 35 | """ |
||
| 36 | |||
| 37 | 1 | # ------------------------------------------------------------------------------------------------------------------ |
|
| 38 | 1 | def test(self, subtraject: Subtraject) -> bool: |
|
| 39 | """ |
||
| 40 | Test of een subtraject voldoet aan een attribuutgroepkoppeling. |
||
| 41 | |||
| 42 | :param Subtraject subtraject: Het subtraject. |
||
| 43 | |||
| 44 | :rtype: bool |
||
| 45 | 1 | """ |
|
| 46 | aantal = self._attribuut.tel(subtraject) |
||
| 47 | |||
| 48 | return self._onder_toets_waarde <= aantal <= self._boven_toets_waarde |
||
| 49 | |||
| 51 |