예제 #1
0
 @Deprecated
 @operator(
     value = "neighbors_of",
     content_type = IType.AGENT,
     category = {IOperatorCategory.SPATIAL, IOperatorCategory.SP_QUERIES})
 /* TODO, expected_content_type = { IType.FLOAT, IType.INT } */
 @doc(
     deprecated = "Use 'neighbours_of(topology, agent, distance)' instead",
     usages =
         @usage(
             value =
                 "a list, containing all the agents of the same species than the key of the pair argument (if it is an agent) located at a distance inferior or equal to the right member (float) of the pair (right-hand operand) to the left member (agent, geometry or point) considering the left-hand operand topology.",
             examples = {
               @example(
                   value = "topology(self) neighbors_of self::10",
                   equals =
                       "all the agents located at a distance lower or equal to 10 to the agent applying the operator considering its topology.",
                   test = false)
             }))
 public static IList neighbours_of(final IScope scope, final ITopology t, final GamaPair pair) {
   if (pair == null) {
     return GamaListFactory.EMPTY_LIST;
   }
   Object agent = pair.key;
   return Spatial.Queries._neighbours(
       scope,
       agent instanceof IAgent
           ? In.list(scope, ((IAgent) agent).getPopulation())
           : Different.with(),
       agent,
       pair.value,
       t);
   // TODO We could compute a filter based on the population if it is an agent
 }
예제 #2
0
 @Deprecated
 @operator(
     value = "neighbours_of",
     content_type = IType.AGENT,
     category = {IOperatorCategory.SPATIAL, IOperatorCategory.SP_QUERIES})
 @doc(
     deprecated = "use neighbors_of instead",
     value =
         "a list, containing all the agents of the same species than the argument (if it is an agent) located at a distance inferior or equal to 1 to the right-hand operand agent considering the left-hand operand topology.",
     masterDoc = true,
     examples = {
       @example(
           value = "topology(self) neighbours_of self",
           equals =
               "returns all the agents located at a distance lower or equal to 1 to the agent applying the operator considering its topology.",
           test = false)
     },
     see = {"neighbors_of"})
 public static IList neighbours_of_deprecated(
     final IScope scope, final ITopology t, final IAgent agent) {
   return Spatial.Queries.neighbours_of(scope, t, agent);
 }
예제 #3
0
 @Deprecated
 @operator(
     value = "neighbours_of",
     content_type = IType.AGENT,
     category = {IOperatorCategory.SPATIAL, IOperatorCategory.SP_QUERIES})
 /* TODO, expected_content_type = { IType.FLOAT, IType.INT } */
 @doc(
     deprecated = "use neighbors_of instead",
     usages =
         @usage(
             value =
                 "a list, containing all the agents of the same species than the left argument (if it is an agent) located at a distance inferior or equal to the third argument to the second argument (agent, geometry or point) considering the first operand topology.",
             examples = {
               @example(
                   value = "neighbours_of (topology(self), self,10)",
                   equals =
                       "all the agents located at a distance lower or equal to 10 to the agent applying the operator considering its topology.",
                   test = false)
             }))
 public static IList neighbours_of_deprecated(
     final IScope scope, final ITopology t, final IShape agent, final Double distance) {
   return Spatial.Queries.neighbours_of(scope, t, agent, distance);
 }
예제 #4
0
 @Deprecated
 @operator(
     value = "neighbours_at",
     content_type = ITypeProvider.FIRST_TYPE,
     category = {IOperatorCategory.SPATIAL, IOperatorCategory.SP_QUERIES})
 @doc(
     deprecated = "use neighbors_at instead",
     value =
         "a list, containing all the agents of the same species than the left argument (if it is an agent) located at a distance inferior or equal to the right-hand operand to the left-hand operand (geometry, agent, point).",
     comment =
         "The topology used to compute the neighbourhood  is the one of the left-operand if this one is an agent; otherwise the one of the agent applying the operator.",
     examples = {
       @example(
           value = "(self neighbours_at (10))",
           equals =
               "all the agents located at a distance lower or equal to 10 to the agent applying the operator.",
           test = false)
     },
     see = {"neighbors_at"})
 public static IList neighbours_at_deprecated(
     final IScope scope, final IShape agent, final Double distance) {
   return Spatial.Queries.neighbours_at(scope, agent, distance);
 }