## 2 Methodology
### Methods: AOSR Heuristics
_Percept-Builder_ utilises its method of _Request-Analyser_() to identify two of its variations: requests from ECU side agents; and requests from the CRM side agents; and performs tasks accordingly to the context to ensure it reaches the desires of the requesting agents. The AOSR algorithm completely complies with the FIPA-agent communication language (ACL) protocol [40] to perform negotiation between different agents. All messages between different AOSR components follow ACL constructs. The _ACLmessageReceiver()_ function in Algorithm 2 extracts all the subcomponents of a request or desire and identifies the information related to product details, e.g., their SKUs, characteristics, or quantity. The _Extract-Characteristics()_ function fetches all the characteristics related to a particular product highlighted in the shipment or delivery details. The AOSR algorithm recommends advance notification of products shipment (ASN) or delivery (ADN), as discussed in AOSR's _6-Feature Strategy_[26]. The set of characteristics included in ASN/ADN helps to find the right match to determine a suitable rack to place the product within the warehouse at an appropriate location. ```
1:procedureActualor-SearchRack
2:\(Initiate\) Belief-Builder()
3:\(Initiate\) Knowledge-Builder()
4:foreach P in ASN:
5: matchCharacteristics(KnowledgeThread(Rack, P))
6: matchCapacity(KnowledgeThread(Rack, P))
7:ifmatchedthen
8:\(AvailableRacks[]\gets KnowledgeThread(RackNo)\)
9:\(AvailableRackLevels[]\gets KnowledgeThread(RackLevel)\)
10:endif
11:goto loop
12:ifthenCheckConsolidation(AvailableRacks[],AvailableRackLevels[])
13:\(AvailableRacks[]\gets fewest(AvailableRacks[],AvailableRackLevels[]))\)
14:else
15:\(AvailableRack\gets nearest(AvailableRacks[],AvailableRackLevels[]))\)
16:endif
17:returnAvailableRack
18:endprocedure
```  
**Algorithm 3** Overview of Actuator-SearchRack Heuristics. If a request comes from an ECU side agent, the first step that the AOSR planner agent performs is to find a suitable rack, as explained in Algorithm 3. Other than matching the characteristics of products with those of racks, capacity is one of the main concerns in order to completely store the batch. In contrast to a standard WMS ([4; 41]), AOSR 2.0 provides an advanced and deeper approach to assign a rack to a product. It does not just randomly assign a product to an available rack but instead analyses the list of available racks based on capacity and location and then attempts to consolidate a slot within the rack, e.g., by justifying the maximum possible space to completely fill the same rack level (i.e., if a shipment is received with three products and there two of the same product in a rack already, then it will place the new products in the same rack to take it to its full capacity of five products), rather than putting the dispersed products into different locations. Although this is not always achievable because of capacity and quantity mismatch, it first tries and then finds the nearest possible rack, which ultimately reducesthe overall activity-time on the shop floor. If the method of _SearchRack()_ cannot find a suitable available rack, only then does it attempt to find an available expedition area (EA) while, in parallel, it checks for any upcoming delivery orders from its _Knowledge Base_. If it perceives that some products need to be delivered within a given time threshold (with the threshold defined by the company, e.g., 3-5 days), it initiates a task to move the existing products from the racks and put the quantity specified in the ADNs into an available EA so it can place products coming through ASNs directly into racks. Then, on the delivery day, it picks the products from EA and ships them. Thus, through this re-slotting mechanism, the warehouse remains more organised and better managed. If _Request-Analyser_ receives a request from CRM side agents, the _Request-Analyser_ utilises the _RetrieveLocation()_ function, highlighted in Algorithm 4, to build a list of possible locations for the required product and quantity.