Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Environment.java to AIMA4e #378

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ Java implementation of algorithms from Russell and Norvig's "Artificial Intellig
<td><b>Name/Pseudocode (in book)</b></td>
<td><b>Implementation(s)</b></td>
</tr>
<tr>
<td>2.?</td>
<td>??</td>
<td>Environment</td>
<td><a href="core/src/main/java/aima/core/agent/basic/Environment.java">Environment</a></td>
</tr>
<tr>
<td>2.?</td>
<td>??</td>
Expand Down
33 changes: 33 additions & 0 deletions core/src/main/java/aima/core/agent/basic/Environment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package aima.core.agent.basic;

import aima.core.agent.api.Agent;
import java.util.List;

/**
* Possible environments in which Agent(s) can percieve and act.
*
* @author Ritwik Sharma
*/
public interface Environment {

/**
* Returns the Agent(s) belonging to this Environment.
*/
List<Agent> getAgents();
Copy link
Contributor

@utsavoza utsavoza Mar 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agent in AIMA4e is a generic interface with a different API than in AIMA3e. Any implementation of this interface would possibly be fraught of unchecked warnings. Please verify the implementation by giving a supporting example environment that implements this interface.


/**
* Add an agent to the Environment.
*/
void addAgent(Agent agent);

/**
* Remove an agent from the environment.
*/
void removeAgent(Agent agent);

/**
* Returns "true" if the Environment is finished with its current task(s).
*/
boolean isDone();

}