Question: ATTENTION!!: I have asked this question 2 times before. Both times I have gotten wrong answers. I am looking for the complete ASP program as
ATTENTION!!: I have asked this question times before. Both times I have gotten wrong answers. I am looking for the complete ASP program as the full answer. This means, the program should:
Run if i copypaste it in CLINGO I am using online compiler: POTASSCO
Give me the expected output for the exercise
Both answers I have gotten, consist of code that has errors, does not run, or gives me the wrong output.
For example lets look at this answer that i got by an expert:
cleanableA B : roadA B not blockedA B
reachableA B : cleanableA B
inrouteA B : reachableA B : reachableA B
: cleanableA B not inrouteA B
visitedX : startX
visitedY : inrouteX Y visitedX
: cleanableX not visitedX
: cleanable X not visitedX
: startS not visitedS
#minimize inrouteA B : reachableA B
This is wrong. Because if i use: #show visited i can see that it does not go back to the start, which is something required by the exercise.
Also, for some test cases, the output is wrong, since the program mistakenly uses the blocked roads for its route, even though as per the exercise, that should not happen blocked roads are inaccessible
If you are not an ASP expert please do not answer this question.
If you are not willing test your code extensively in CLINGO to see that it runs and the output is correct for multiple test cases, please do not answer this question.
Thank you for your understanding
PROBLEM:
The city of Tokyo, the most technologically advanced city in the world, wants to test an automated robot sweeper designed for cleaning its streets. The sweeper is mounted on a vehicle, and its operation is simple: it always has its cleaning function activated, and to clean a street, it must move from the beginning to the end of that street. The task is to develop an ASP program that will determine the daily route for the sweeper, which must satisfy the following conditions:
All streets in the city that are accessible to the robot sweeper must be cleaned. In other words, the route must guarantee that the sweeper will pass through all accessible streets.
Some streets are inaccessible, and the program is provided with a list of these blocked streets. Naturally, the robot sweeper cannot pass through these streets, so they should not be included in the route.
The robot sweeper cannot teleport, so the sequence of streets in the route must correspond to neighboring streets.
The route should minimize the number of streets that are cleaned more than once. It is understood that the sweeper must respect traffic directions. For simplicity, we assume that if the sweeper passes through a street in any direction, that street is considered cleaned. The sweeper starts at a specific point on the map its storage location and at the end of the route, it must return to the same point. The problem can be modeled by representing the streets as a directed graph, where the challenge is to traverse all the edges ie streets at least once, while minimizing the number of streets that are cleaned more than once. The direction of an edge represents the correct traffic direction for that street.
The input consists of a set of roadAB predicates for oneway streets directed from A to B a set of blockedAB predicates for streets that are inaccessible, and a given startA predicate for the starting point of the sweeper which is also the point it must return to
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
