Browse Source
- korrekte behandlung von Permutationen - hervorhebung von Summanden - Spalte mit Infos über Moves - optionen, um alle Gewichte zu zeigen / alle Summen zu zeigenmaster
4 changed files with 151 additions and 51 deletions
@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env python3 |
||||
# -*- coding: utf-8 -*- |
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||||
# IMPORTS |
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||||
|
||||
from __future__ import annotations; |
||||
|
||||
from src.thirdparty.maths import *; |
||||
from src.thirdparty.types import *; |
||||
|
||||
from src.models.rucksack.mask import *; |
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||||
# EXPORTS |
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||||
|
||||
__all__ = [ |
||||
'EnumBranchAndBoundMove', |
||||
'Step', |
||||
]; |
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||||
# CLASS Move |
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||||
|
||||
class EnumBranchAndBoundMove(Enum): |
||||
NONE = -1; |
||||
BOUND = 'bound'; |
||||
BRANCH = 'branch'; |
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||||
# CLASS Step |
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||||
|
||||
@dataclass |
||||
class Step(): |
||||
bound: float = field(); |
||||
bound_subtree: float = field(); |
||||
stack_str: str = field(); |
||||
choice: List[Fraction] = field(); |
||||
order: List[int] = field(); |
||||
# the indexes upon which the greedy algorithm is carried out: |
||||
indexes: List[int] = field(); |
||||
pad: MaskValue = field(); |
||||
move: EnumBranchAndBoundMove = field(default=EnumBranchAndBoundMove.NONE); |
Loading…
Reference in new issue