From 814ddc4ccfb9d08328ecd0f8aa088e091f85a9df Mon Sep 17 00:00:00 2001 From: Gerard Canal Date: Sun, 9 Jul 2023 20:47:16 +0100 Subject: [PATCH 1/2] Remove unused import in temporal_network.py Removing statistics.correlation import which was not found in statistics nor used in the file --- temporal_networks/temporal_network.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/temporal_networks/temporal_network.py b/temporal_networks/temporal_network.py index 82cbbfd..318279e 100644 --- a/temporal_networks/temporal_network.py +++ b/temporal_networks/temporal_network.py @@ -1,7 +1,6 @@ #from msilib.schema import Error from queue import PriorityQueue import json -from statistics import correlation from xmlrpc.client import Boolean import copy from math import inf @@ -641,4 +640,4 @@ def __init__(self) -> None: self.correlations = [] def add_correlation(self, constraints: list[Constraint]) -> None: - self.correlations.append(Correlation(constraints)) \ No newline at end of file + self.correlations.append(Correlation(constraints)) From 177852adfab9578b5f4bd74155f014783e2f1e86 Mon Sep 17 00:00:00 2001 From: Gerard Canal Date: Sat, 29 Jul 2023 14:14:30 +0100 Subject: [PATCH 2/2] Fix AttribtueError in ub/lb --- temporal_networks/temporal_network.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/temporal_networks/temporal_network.py b/temporal_networks/temporal_network.py index 318279e..ff23769 100644 --- a/temporal_networks/temporal_network.py +++ b/temporal_networks/temporal_network.py @@ -119,10 +119,18 @@ def sd(self): def lb(self): return self.duration_bound["lb"] + @lb.setter + def lb(self, x): + self.duration_bound["lb"] = x + @property def ub(self): return self.duration_bound["ub"] + @ub.setter + def ub(self, x): + self.duration_bound["ub"] = x + class Correlation: """ Represents a correlation across a number of probabilistic "pstc" type constraints. Given n probabilistic constraints, such that for i = 1,2,...,n,