{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":14803,"path":"field-service-management/field-service-scheduling/example-for-dynamic-scheduling.md","title":"Example - Dynamic Scheduling","bundle":null,"doc_type":null,"release":"australia","body":"\n# Example - Dynamic Scheduling\n\nExplore how Dynamic Scheduling prioritizes the best agent for a task, focusing on key matching criteria.\n\nConsider a scenario in which all field technicians work in the same region. Since all technicians are going to be the same relative distance from a task, availability to perform a task is the most important criteria, followed by matching part requirements.\n\nThis example assumes the following information.\n\n-   Maximum number of hours available in a day: 8\n-   Total parts required: 5\n\nMatching Criteria Values are described in the following list. Alice and Mack are Global Teller Systems field technicians.\n\n-   Alice has 5 hours of availability and 2 of the required parts.\n-   Mack has 8 hours of availability and 1 of the required parts.\n-   **Availability Today** criteria is assigned a weight of **20**, as it is most important.\n-   **Agents with most parts** criteria is assigned a weight of **10**, as it should be considered as the next most important criteria.\n-   All criteria have a ranking method of **More is better**.\n\n|Alice|Criterion|Weight|Ranking Method|Mack|\n|-----|---------|------|--------------|----|\n|5|Availability Today|20|More is better|8|\n|2|Agents with most parts|10|More is better|1|\n\nNow that we have the matching criteria values, we can calculate the criterion rating.\n\nFirst, calculate a number for each criterion, based on the sample work order task data provided:\n\nAvailable today:\n\nAlice: 5 / 8 = 0.625 \\(with 8 being the maximum number of hours\\).\n\nMack: 8 / 8 = 1.\n\nTechnicians with most parts:\n\nAlice: 2/5 = 0.4 \\(with 5 being the total number of parts required\\).\n\nMack: 1 / 5 = 0.2.\n\n|Alice|Criterion|Weight|Ranking Method|Mack|\n|-----|---------|------|--------------|----|\n|5/8|Availability today|20|More is better|8/8|\n|2/5|Technicians with the most parts|10|More is better|1/5|\n\nAfter we have the matching values and the criterion rating we can calculate the technician ranking for Alice and Mack.\n\nThe following is the technician ranking for Alice.\n\nMultiply the number for each criterion by the criterion weight and then divide the result by the total of all criterion weight. Repeat for each criterion and add the results.\n\nFormula: \\(Criteria\\_1 rating x Criteria\\_1 weight\\) / total criterion weight + \\(Criteria\\_2 rating x Criteria\\_2 weight\\) / total criterion weight +\\(Criteria\\_3 rating x Criteria\\_3 weight\\) / total of criterion weight = technician rank/score.\n\n|Criterion|Criterion rating with calculation|Weight|Score|\n|---------|---------------------------------|------|-----|\n|Availability Today|0.625|20|0.4166|\n|Technicians with most parts|0.4|10|0.1333|\n|Total| |30|0.5499|\n\nThe following is the technician ranking for Mack.\n\nMultiply the number for each criterion by the criterion weight and then divide the result by the total of all criterion weight. Repeat for each criterion and add the results.\n\nFormula: \\(Criteria\\_1 rating x Criteria\\_1 weight\\) / total criterion weight + \\(Criteria\\_2 rating x Criteria\\_2 weight\\) / total criterion weight +\\(Criteria\\_3 rating x Criteria\\_3 weight\\) / total of criterion weight = technician rank/score.\n\n|Criterion|Criterion rating with calculation|Weight|Score|\n|---------|---------------------------------|------|-----|\n|Availability Today|1|20|0.6667|\n|Technicians with most parts|0.2|10|0.0667|\n|Total| |30|0.7334|\n\nResult: Mack \\(0.7334\\) has a higher ranking score than Alice \\(0.5599\\), therefore Mack is assigned the task.\n\n## Consider distance from task in addition to matching criteria\n\nConsider how the calculation would change if the field agents were not all in the same, small region. When distance matters, the **Current Distance From Task** or **Distance From Task** matching criteria can be used. These distance from task criteria are unlike the other criteria because the closer the field agent is to the task, the better. Therefore, unlike the other criteria, a lower number here is better than a higher number. The less is better adjustment is necessary to make a true comparison of the resulting scores. An adjustment is made by subtracting the score from one \\(1\\) for any criterion using the ranking method Less is better.\n\n**Note:** **Distance From Task** calculation occurs in the **LocationFromTask** Script Includes and **Current Distance From Task** calculation occurs in the **CurrentLocationFromTask** Script Includes. This calculation takes the task latitude and longitude and compares it to the agent's latitude and longitude, as expressed in miles.\n\n**Related topics**  \n\n\n[Configure dynamic scheduling](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/field-service-management/field-service-scheduling/create-dynamic-scheduling-config.md)\n\n"}}