---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
<ipython-input-24-86bf0d756077> in <module>()
1 for i, trip in enumerate(trips[0:2]):
----> 2 v, q, p,d = dynamicprogramming.compute(trip=trip, controls=bat_controls, battery=supercap, vehicle=vehicle, cost_function=cc_cf, soc_states=50)
3 with open('pickles/v%03d.pickle', 'wb') as f:
4 pickle.dump(v, f)
/Users/astyler/anaconda/lib/python2.7/site-packages/hybridpy/learning/dynamicprogramming.pyc in compute(trip, controls, soc_states, gamma, cost_function, vehicle, battery)
56 # control is power supplied from the ICE, battery makes up the difference
57 costs_to_go = [cost_to_go(soc + battery.compute_delta_soc_and_current(soc, power_demand - control, duration)[0]) for
---> 58 control in controls]
59 q_function[t][i] = [
60 cost_function(vehicle.compute_fuel_rate(control, soc), power_demand - control, duration) + (gamma * ctg) for
/Users/astyler/anaconda/lib/python2.7/site-packages/hybridpy/learning/dynamicprogramming.pyc in cost_to_go(soc)
51 return value_function[t + 1][-1] # can't charge above max, return value at max
52 else:
---> 53 return next_value_slice(soc) # return cost to go of next slice
54
55 for (i, soc) in enumerate(socs):
/Users/astyler/anaconda/lib/python2.7/site-packages/scipy/interpolate/polyint.pyc in __call__(self, x)
77 """
78 x, x_shape = self._prepare_x(x)
---> 79 y = self._evaluate(x)
80 return self._finish_y(y, x_shape)
81
/Users/astyler/anaconda/lib/python2.7/site-packages/scipy/interpolate/interpolate.pyc in _evaluate(self, x_new)
497 x_new = asarray(x_new)
498 out_of_bounds = self._check_bounds(x_new)
--> 499 y_new = self._call(self, x_new)
500 if len(y_new) > 0:
501 y_new[out_of_bounds] = self.fill_value
/Users/astyler/anaconda/lib/python2.7/site-packages/scipy/interpolate/interpolate.pyc in _call_linear(self, x_new)
460 x_hi = self.x[hi]
461 y_lo = self._y[lo]
--> 462 y_hi = self._y[hi]
463
464 # Note that the following two expressions rely on the specifics of the
KeyboardInterrupt: