parameters: (self, pos2, len_veh2, speed, dist1, dist2, vehicles)
return_statement: return p_from, p_to
docstring: Returns critical position interval of vehicle-platoon on main line
          with respect to the starting position of a vehicle at entry line.
          The returned critical position interval(pos_from, pos_to), which should
          ideally be free of vehicles.
          pos_from refers to the position of the nose of a vehicle on the main line
          pos_to refers to the position of the tail of the platoon on the main line.
docstring_summary: Returns critical position interval of vehicle-platoon on main line
          with respect to the starting position of a vehicle at entry line.
          The returned critical position interval(pos_from, pos_to), which should
          ideally be free of vehicles.
          pos_from refers to the position of the nose of a vehicle on the main line
          pos_to refers to the position of the tail of the platoon on the main line.
docstring_tokens: Returns critical position interval of vehicle - platoon on main line with respect to the starting position of a vehicle at entry line . The returned critical position interval ( pos_from pos_to ) which should ideally be free of vehicles . pos_from refers to the position of the nose of a vehicle on the main line pos_to refers to the position of the tail of the platoon on the main line .
function: def get_pos_crit_entry(self, pos2, len_veh2, speed, dist1, dist2, vehicles):
          """
          Returns critical position interval of vehicle-platoon on main line
          with respect to the starting position of a vehicle at entry line.
          The returned critical position interval(pos_from, pos_to), which should
          ideally be free of vehicles.
          pos_from refers to the position of the nose of a vehicle on the main line
          pos_to refers to the position of the tail of the platoon on the main line.
  
          """
          print 'get_pos_crit_entry pos2=%.1f, v=%.1f, d1=%.1f, d2=%.1f' % (pos2, speed, dist1, dist2)
          # see 191030
          decel_emergency = vehicles.decel_emergency.get_value()
          decel_comfort = vehicles.decel_comfort.get_value()
          time_emergency = vehicles.time_emergency.get_value()
          s2 = 0.5*speed**2/decel_comfort
          delta2 = dist2 - pos2 - s2
  
          s1 = speed**2/decel_comfort
          s_safe = time_emergency*speed + 0.5*speed**2/decel_emergency
          p_to = dist1 - delta2 - s1 + s_safe
          p_from = p_to-len_veh2-2*s_safe
          # print '  delta2=%.1f, s2=%.1f, s1=%.1f, ss=%.1f, CI=(%.1f,%.1f)'%(delta2,s2,s1,s_safe,p_from,p_to)
          return p_from, p_to
function_tokens: def get_pos_crit_entry ( self , pos2 , len_veh2 , speed , dist1 , dist2 , vehicles ) : print 'get_pos_crit_entry pos2=%.1f, v=%.1f, d1=%.1f, d2=%.1f' % ( pos2 , speed , dist1 , dist2 ) # see 191030 decel_emergency = vehicles . decel_emergency . get_value ( ) decel_comfort = vehicles . decel_comfort . get_value ( ) time_emergency = vehicles . time_emergency . get_value ( ) s2 = 0.5 * speed ** 2 / decel_comfort delta2 = dist2 - pos2 - s2 s1 = speed ** 2 / decel_comfort s_safe = time_emergency * speed + 0.5 * speed ** 2 / decel_emergency p_to = dist1 - delta2 - s1 + s_safe p_from = p_to - len_veh2 - 2 * s_safe # print '  delta2=%.1f, s2=%.1f, s1=%.1f, ss=%.1f, CI=(%.1f,%.1f)'%(delta2,s2,s1,s_safe,p_from,p_to) return p_from , p_to