master > master: code py - display verbessert

This commit is contained in:
RD
2022-06-14 01:53:48 +02:00
parent ea36c82728
commit 026cd6addf
3 changed files with 43 additions and 21 deletions

View File

@@ -34,6 +34,10 @@ class Solution(SolutionRaw):
def support(self) -> List[float]:
return [ i for i, v in enumerate(self.vector) if v > 0 ];
@property
def vector_support(self) -> List[float]:
return [ v for v in self.vector if v > 0 ];
@property
def total_weight(self) -> float:
return sum([ self.vector[i]*x for (i, x) in zip(self.support, self.weights) ]);