<p>You can use Imagination-augmented to predict wrong and fatal actions. <a href="https://www.youtube.com/watch?v=llwAwE7ItdM" rel="nofollow noreferrer">Deep mind is working on it</a> and I believe it is a great solution to many problems. You need to predict whether the best solution is to take a few steps forward so you do not get hit or go back a few steps.</p>

CC BY-SA 3.0
2017-08-31T15:58:27.900Z
2017-08-31T15:58:27.900Z
GIA
<p>Any AI algorithm depends on the environment, and available actuators and sensors. In our case, the environment is a road, street, etc. The primary actuator includes wheels (or legs) of the robot. Sensors include a camera, sonar system, etc.<br>
A simple Model-based reflex algorithm can work in your case:<br></p>

<pre><code>function MODEL-BASED-REFLEX-AGENT(percept) returns an action
    persistent: state, agents' current conception of the world state
                model, description of how hte next state depends on current state and action
                rules, a set of condition-action rules
                action, most recent action, initially none
    state &lt;-- UPDATE-STATE(state, action, percept, model)
    rule &lt;-- RULE-MATCH(state, rules)
    action &lt;-- rule.ACTION
    return action
</code></pre>

<p>Most of the terms and functions are self-explanatory and I will try to explain the important points. This implementation helps the robot to <strong>keep track of the external environment by maintaining internal state</strong> that depends on the percept history. Updating the internal state requires <em>how the environment works without our agent</em> in it. For e.g., Cars stop at red light and start moving on the green signal. Another thing that is required is <em>how the actions of our agent will affect the world</em>. Since your robot is only trying to cross the road there are not many cases here. Simple things include, stopping motors will stop the bot and starting them will move it forward.<br><br>
The algorithm above shows <strong>how the current percept combined with the old internal state result in generating the updated description of the world, based on agent's model of how the world works</strong>. Thus, agent's model of how the world works is the most important part. UPDATE-STATE is responsible for creating new internal state description. The actual implementation of this will depend on the environment and technology that is being used.<br><br>
The above algorithm has been taken from the book, <em>Artificial Intelligence: A Modern Approach</em>, for agents working in the partially observable environment. Implementation of many functions also depends on how complex you want your robot to be. For e.g., we haven't considered the case of looking up while crossing the road. This is possible that something might be falling from the sky, highly improbable, but possible. The list like this never stops in real life environments.</p>

CC BY-SA 3.0
2018-03-31T05:05:42.900Z
2018-03-31T05:05:42.900Z
Ugnes
<p>I want to write an algorithm which indicates to a robot the first point in time when it is reasonably safe to cross a road.  Assume that the robot's goal is to travel to a location that requires a road crossing and that the robot is ready to cross.</p>

<p>Simple algorithms and decision making will probably not suffice.  What features and capabilities must the algorithm have to provide crossing safety?  What existing AI methods might be useful to consider for this endeavor?</p>

<p>For the first iteration, we can assume the traffic pattern is normal in that no vehicles are driving over the curb and there are no high speed chases or other safety related abnormalities.</p>

<algorithm><learning-algorithms>
Approaches to an algorithm for crossing a road
Ruchit Vithani
# Approaches to an algorithm for crossing a road

(Asked by: username_0 on 2017-08-26)

I want to write an algorithm which indicates to a robot the first point in time when it is reasonably safe to cross a road. Assume that the robot's goal is to travel to a location that requires a road crossing and that the robot is ready to cross.

Simple algorithms and decision making will probably not suffice. What features and capabilities must the algorithm have to provide crossing safety? What existing AI methods might be useful to consider for this endeavor?

For the first iteration, we can assume the traffic pattern is normal in that no vehicles are driving over the curb and there are no high speed chases or other safety related abnormalities.

**Tags:** algorithm, learning-algorithms


---

## 2 answers

### Answer by username_2 on 2018-03-31. Score: 2 | Accepted answer

Any AI algorithm depends on the environment, and available actuators and sensors. In our case, the environment is a road, street, etc. The primary actuator includes wheels (or legs) of the robot. Sensors include a camera, sonar system, etc.
A simple Model-based reflex algorithm can work in your case:
function MODEL-BASED-REFLEX-AGENT(percept) returns an action
    persistent: state, agents' current conception of the world state
                model, description of how hte next state depends on current state and action
                rules, a set of condition-action rules
                action, most recent action, initially none
    state <-- UPDATE-STATE(state, action, percept, model)
    rule <-- RULE-MATCH(state, rules)
    action <-- rule.ACTION
    return action

Most of the terms and functions are self-explanatory and I will try to explain the important points. This implementation helps the robot to keep track of the external environment by maintaining internal state that depends on the percept history. Updating the internal state requires how the environment works without our agent in it. For e.g., Cars stop at red light and start moving on the green signal. Another thing that is required is how the actions of our agent will affect the world. Since your robot is only trying to cross the road there are not many cases here. Simple things include, stopping motors will stop the bot and starting them will move it forward.
The algorithm above shows how the current percept combined with the old internal state result in generating the updated description of the world, based on agent's model of how the world works. Thus, agent's model of how the world works is the most important part. UPDATE-STATE is responsible for creating new internal state description. The actual implementation of this will depend on the environment and technology that is being used.
The above algorithm has been taken from the book, Artificial Intelligence: A Modern Approach, for agents working in the partially observable environment. Implementation of many functions also depends on how complex you want your robot to be. For e.g., we haven't considered the case of looking up while crossing the road. This is possible that something might be falling from the sky, highly improbable, but possible. The list like this never stops in real life environments.


---

### Answer by username_1 on 2017-08-31. Score: 0

You can use Imagination-augmented to predict wrong and fatal actions. [Deep mind is working on it](https://www.youtube.com/watch?v=llwAwE7ItdM) and I believe it is a great solution to many problems. You need to predict whether the best solution is to take a few steps forward so you do not get hit or go back a few steps.


---

