# A Smart and Mechanized Agricultural Application: From Cultivation to Harvest
## 3 Materials and Methods
### Harvesting Phase  
The purpose of this phase is to come up with a road map for each autonomous robot. At this stage, the SCSO and similar algorithms may be not very successful in their rationality, as it is our goal to generate paths and find a good route. Therefore, a new method was proposed by utilizing the one of the best metaheuristic algorithms (ACO) for this concept. Based on this path, each robot will begin its task of picking (harvesting) crops in the most efficient manner. In other words, with this route, each robot collects the crops efficiently, making the most profit. Moreover, this goal is achieved in as short a time as possible and with the least power consumption. This new algorithm is proposed to achieve these three intermediate targets (_max-profit_, _min-energy_, _min-time_) together in a balanced way. In summary, the output (goal) of the harvest phase is finding the optimal path for each autonomous robot. The ACO [57] algorithm is inspired by the real-life behavior of ants. Although ants are not insects that live in a swarm model, they help and guide each other by using chemical deposits called pheromones, and as a result, they act like a smart colony. In the classical ACO, each ant starts from a point, goes hunting, and returns to its home (start). That is, each ant starts eating from the nest and then returns to the nest. However, in RACO, each ant starts from a point and only tries to reach the prey, and the concept of returning to the nest is not in question in this algorithm. It is worth remembering that this algorithm is not a new ACO variant. This algorithm is inspired by the concept of ACO for solving just this problem and similar problems. The second main difference between the proposed algorithm and ACO is based on the concept of pheromones. In the classic ACO, in each iteration each ant releases pheromones on each path it prefers, so the pheromone values of the chosen paths are constantly updated. Since the pheromone density is high in the most preferred route, the relevant route is chosen as the best route. Additionally, as the number of iterations increases, some pheromone evaporates from the amount present on each path. This prevents it from facing problems such as local optima. For this, a matrix is defined. However, the concept of pheromones is not fully similar in RACO, and instead, a similar matrix is defined, reflecting the increase in growth rates of the crops planted in each iteration. In addition, when each product is selected by the ant, it defines it as the product that has been collected, and the value of that product in the relevant matrix is decreased. In fact, the matrix defined in RACO shows the growth rates of crops. Items that are not collected increase in value as the iteration goes on (contrary to evaporation), and items that are collected are devalued (a very small number close to zero). In short:  
1. In classical ACO, pheromones evaporate as time progresses, in RACO the crops grow as time passes. Figure 2: The device used as an IoT node in the field [55; 5]. 2. In classical ACO, the pheromone ratio of the most preferred routes increases, in RACO, the product is collected and its value decreases in the current table of the product, while on the other hand, the value of the profit parameter increases. Since this model is applied on a continuous field, the same process continues as the harvested crops begin to grow and mature again, and therefore the algorithm works smoothly. This presents a sustainable farming mechanism for all three phases described in our study. The main idea of this proposed algorithm is to model the problem as a search for the best path by constructing a path graph representing the states of the problem. Therefore, it can also be used to solve other problems similar to the product aggregation problem.