We are experimenting the TSP problem with the Dynamic Islands Model.
In [1]:
%pylab inline
In [2]:
import pandas as pd
from pandas import Series, DataFrame, Panel
pd.__version__
Out[2]:
In [3]:
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rc('figure', figsize=(10, 8))
mpl.__version__
Out[3]:
In [4]:
data_set = [pd.read_csv('result_monitor_%d' % i, index_col='DateTime', parse_dates=True) for i in range(2)]
A resampling is made in order to reduce the number of rows used for plotting. We use a time step at 100ms.
In [18]:
nbindis = pd.concat([data_set[i]['nb_individual_isl%d' % i].resample('s', fill_method='pad') for i in range(2)], axis=1)
_max = nbindis.max(axis=1); _max.name = 'max'
_avg = nbindis.mean(axis=1); _avg.name = 'avg'
#nbindis = nbindis.join(_max).join(_avg)
#nbindis.plot()
nbindis.plot(subplots=True)
nbindis.cumsum().plot()
Out[18]:
In [19]:
nbindis.describe()
Out[19]:
In [6]:
bests = pd.concat([data_set[i]['best_value_isl%d' % i].resample('s', fill_method='pad') for i in range(2)], axis=1)
_max = bests.max(axis=1); _max.name = 'max'
_avg = bests.mean(axis=1); _avg.name = 'avg'
#bests = bests.join(_max).join(_avg)
bests.plot()
#bests.plot(subplots=True)
Out[6]:
In [20]:
bests.describe()
Out[20]:
In [7]:
mig_data_set = [pd.read_csv('result_monitor_%d' % i, index_col='migration') for i in range(2)]
In [16]:
attractiveness = pd.concat([pd.concat([mig_data_set[j]['P%dto%d' % (j,i)] for j in range(2)],axis=1).sum(axis=1) for i in range(2)],axis=1)
attractiveness.cumsum().plot()
Out[16]:
In [21]:
attractiveness.describe()
Out[21]: