def fitter_type4(self,i,j):
        if i<0 or j>(len(self.observations)+1) or i>j:
            raise Exception("fitting between {} and {} incompatible when number of acquisitions have been {}".format(i,j,len(self.observations)))

        curr_trajectory = defs.trajectory(3,self.observations[i:j])
        res4 = estimate_individual_type(curr_trajectory,3)
        return res4,0.1
                list_of_observations.append(curr_obs)

                if idx == 55:
                    print("Adding changepoint")
                    set_of_possible_new_types = set_of_types.copy()
                    set_of_possible_new_types.remove(pre_type)
                    post_type = random.sample(set_of_possible_new_types, 1)
                    a.agents[tracking_agent_id].tp = post_type[0]

                print("set {} iter {} exper {} tp {}".format(lm, idx, j, i))

            if a.terminal:
                print("Simulation ended")
                curr_time.append(idx)

            curr_traj = defs.trajectory(a.agents[tracking_agent_id].tp,
                                        list_of_observations)
            if idx > 56:
                cp_curr_traj = defs.cp_trajectory(pre_type, post_type, 25,
                                                  list_of_observations)
                cp_traj_list.append(cp_curr_traj)
            traj_list.append(curr_traj)

        times.append(curr_time)

    times = np.array(times)
    # print(np.mean(times,axis=1))
    tot_times.append(times)

# print(np.mean(tot_times,axis=0))
import pickle
import src.agents.adhoc_agent as sadhoc