From 16f9b2d7c32aa72dcebb96f07ef905e9ad163878 Mon Sep 17 00:00:00 2001 From: Pietro Date: Sat, 17 Apr 2021 10:27:59 +0200 Subject: [PATCH] -1 Finale --- .gitignore | 1 + PyCTBN/PyCTBN/structure_graph/trajectory_generator.py | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 79df440..f0c0376 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ __pycache__ test.py test_1.py test1.json +test2.json diff --git a/PyCTBN/PyCTBN/structure_graph/trajectory_generator.py b/PyCTBN/PyCTBN/structure_graph/trajectory_generator.py index 30b7232..2349e6f 100644 --- a/PyCTBN/PyCTBN/structure_graph/trajectory_generator.py +++ b/PyCTBN/PyCTBN/structure_graph/trajectory_generator.py @@ -66,6 +66,10 @@ class TrajectoryGenerator(object): t = time[next] if (max_tr != -1 and n_tr == max_tr) or (t_end != -1 and t >= t_end): + last_row = pd.DataFrame(sigma[-1:].values, columns = sigma.columns) + last_row.loc[0].values[:] = -1 + last_row.loc[0].at["Time"] = round(t, 4) + sigma = sigma.append(last_row, ignore_index = True) self._generated_trajectory = sigma return sigma else: @@ -78,11 +82,6 @@ class TrajectoryGenerator(object): else: cim = cim_obj[0].cim - """ print(self._vnames[next]) - print([current_values.at[p] for p in self._parents[self._vnames[next]]]) - print(current_values) - print(cim) - print() """ cim_row = np.array(cim[current_values.at[self._vnames[next]]]) cim_row[current_values.at[self._vnames[next]]] = 0 cim_row /= sum(cim_row)