Episode lastEpisode = trj.getLastEpisode();
if(tag.equalsIgnoreCase("B") || tag.equalsIgnoreCase("S")){
if(lastEpisode != null && lastEpisode instanceof Move){
lastEpisode.merge(new Move(pt));
}
newEpisode = new Stop(pt);
}
else{
if(lastEpisode != null && lastEpisode instanceof Stop){
newEpisode = new Move(lastPt);
newEpisode.merge(new Move(pt));