Robin Thoni 57fd5d1a06 fixed default fg color on windows | 7 jaren geleden | |
---|---|---|
.idea/.idea.uqac-ia-aspirobot | 7 jaren geleden | |
uqac-ia-aspirobot | 7 jaren geleden | |
.gitignore | 7 jaren geleden | |
AUTHORS | 7 jaren geleden | |
README.md | 7 jaren geleden | |
uqac-ia-aspirobot.sln | 7 jaren geleden |
Aspirobot is a simple® AI agent that vaccums dust in your rooms but pick up your jewels.
Command line
cd uqac-ia-aspirobot
dotnet restore
dotnet build
dotnet run
Visual Studio
Run VS, open solution, wait for package restore, click run (F5)
Rider
Run Rider, open solution, wait for package restore, click run (Shift + F10)
Some behaviors can be configured in Program.cs file:
EnvConfig
(Environment configuration)
Height
: Map heightWidth
: Map widthActionPropability
: Probability that an action occurs in the enviromnent, once per EnvConfig.SleepTime
(>=0, <=100)AddDustProbability
: Probability that a dust is added on the map, only when an action is to be taken (>=0, <=100)RemoveJewelProbability
: Probability that a jewel is removed from the map, only when an action is to be taken,
and EnvConfig.AddDustProbability
does not occur (>=0, <=100)AddJewelProbability
: Probability that a jewel is added on the map, only when an action is to be taken,
and neither EnvConfig.AddDustProbability
nor EnvConfig.RemoveJewelProbability
occur (>=0, <=100)SleepTime
: Time between each iteration in ms (>=0)
AgConfig
(Agent configuration)
SleepTime
: Time between each iteration in ms (>=0)StartX
: Agent start X position (>=0, <EnvConfig.Width
)StartY
: Agent start Y position (>=0, <EnvConfig.Height
)AutoAdjustThinkTimeInterval
: Indicate if agent should try to auto adjust think time interval (AgConfig.ThinkTimeInterval
)ThinkTimeInterval
: Default think time interval in ms (>=0). This variable controls how often the agent will re-evaluate the situationLowPerfomance
: Value that indicate when the performance should be considered as too low. If current performance is less or equal, the agent will bypass AgConfig.ThinkTimeInterval
and re-evaluate the situation anyway
Agent will loop forever (until killed) peforming the following operations:
AgConfig.SleepTime
msFakeEnv implementation will loop forever (until killed) peforming the following operations:
EnvConfig.SleepTime
msEnvConfig.ActionPropability
EnvConfig.AddDustProbability
EnvConfig.RemoveJewelProbability
.
Can only happen if no previous action has been done.EnvConfig.AddJewelProbability
.
Can only happen if no previous action has been done.This agent is coded in .NET Core (C#) using DI (Dependency Injection) and interfaces to abstract implementation and allow to run a virtual environment or a real one without changing anything in the agent implementation
FakeEnv implementation starts one thread for the environment and another one for the agent.
Agent logic is in Agent/*.cs
Agent sensors and effectors interfaces are in Agent/Interfaces/*
Agent sensors that do not directly rely on physical sensors are in Agent/Sensors/*.cs
Agent FakeEnv client implementation is in Agent/FakeEnv/*
FakeEnv client, server, protocol and configuration are defined in Common/*.cs
FakeEnv server implementation is in Environment/*.cs
Some helper methods are defined in Extensions/Extensions.cs
Shared interfaces are in Interfaces/*.cs
Console user interface is in UI/UiConsole.cs