parameters: (instance1, instance2)
return_statement: return 1 if instance1.name > instance2.name else -1
docstring: Compare the instances for journey computation
      :return :   <0 if instance1 has priority over instance2
                  >0 if instance2 has priority over instance1
docstring_summary: Compare the instances for journey computation
      :return :   <0 if instance1 has priority over instance2
                  >0 if instance2 has priority over instance1
docstring_tokens: Compare the instances for journey computation : return : <0 if instance1 has priority over instance2 > 0 if instance2 has priority over instance1
function: def instances_comparator(instance1, instance2):
      """
      Compare the instances for journey computation
      :return :   <0 if instance1 has priority over instance2
                  >0 if instance2 has priority over instance1
      """
      # Choose the instance with greater priority
      if instance1.priority != instance2.priority:
          return instance2.priority - instance1.priority
  
      # Choose the non-free instance
      if instance1.is_free != instance2.is_free:
          return instance1.is_free - instance2.is_free
  
      # TODO choose the smallest region ?
      # take the origin/destination coords into account and choose the region with the center nearest to those coords ?
  
      # Sort by alphabetical order
      return 1 if instance1.name > instance2.name else -1
function_tokens: def instances_comparator ( instance1 , instance2 ) : # Choose the instance with greater priority if instance1 . priority != instance2 . priority : return instance2 . priority - instance1 . priority # Choose the non-free instance if instance1 . is_free != instance2 . is_free : return instance1 . is_free - instance2 . is_free # TODO choose the smallest region ? # take the origin/destination coords into account and choose the region with the center nearest to those coords ? # Sort by alphabetical order return 1 if instance1 . name > instance2 . name else - 1