Function `get_lasts_if_exist` returns the list of last values of some
element of trajectory (i. e. *cost*).
Function `get_maxs_if_exist` return the list of maximum values of some
element of trajectory (i. e. *cost*).
+def get_lasts_if_exist(trajectories, what):
+ """From multiple trajectories get the list of last values.
+
+ Keyword arguments:
+ trajectories -- The list of trajectories.
+ what -- The last values of what to take.
+ """
+ val = []
+ for t in trajectories:
+ try:
+ val.append(t[what][-1])
+ except:
+ val.append(9999)
+ return val
+
+def get_maxs_if_exist(trajectories, what):
+ """From multiple trajectories get the list of maximum values.
+
+ Keyword arguments:
+ trajectories -- The list of trajectories.
+ what -- The maximum values of what to take.
+ """
+ val = []
+ for t in trajectories:
+ try:
+ val.append(max(t[what]))
+ except:
+ val.append(9999)
+ return val
+
def plot_successrate():
"""Plot success rate of single/multi-core implementations."""
LOGF="logs_sq"
def plot_successrate():
"""Plot success rate of single/multi-core implementations."""
LOGF="logs_sq"