Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9219539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:08:20+00:00 2026-06-18T03:08:20+00:00

I am trying to build a simple ant colony simulation. The world is grid

  • 0

I am trying to build a simple ant colony simulation. The world is grid of squares; each one of them can consist of some level of pheromone and any number of ants. There are 2 types of pheromone: food pheromone and nest pheromone. Ants know nothing about the environment, but ants that return to nest follow nest pheromone (in the sense that they almost always choose to move to the cell with the maximum pheromone level, among all nearby cells) and leave food pheromone, and vice versa.

From time to time the ants make random moves not in the direction of maximum pheromone. Each tick of the simulation the ant checks the level of the pheromone in 8 nearby cells, and if the pheromone level in the current cell is less then the maximum of pheromone level in all nearby cell, it adds some pheromone.

The current simulation works pretty well, but the path found is not the optimal one. I have 2 problems that I don’t know how to solve:

  1. How do I simulate the fact that the diagonal move is longer than the non-diagonal move (up,down left or right)?

In the current situation, black path and blue path are equal in length. In realty, however, blue path is shorter.

  1. How should I simulate the diffusion of the pheromone? Right now, the pheromone evaporates over time but there is no diffusion. I have tried to transfer some amount of the pheromone from each cell, each tick of the simulation, to the 8 nearby cells, but the result was a total mess – the whole environment was full with pheromone – I think it was because of the mechanism the ants use to adjust the pheromone level.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T03:08:22+00:00Added an answer on June 18, 2026 at 3:08 am

    On a square grid, it is probably going to be difficult to simulate that the diagonal moves are longer than the horizontal and vertical moves, assuming that ants always move one square per tick (or none). Since the diagonal distance is longer, the ants would effectively have to “run faster” than for the horizontal/vertical moves. This is probably not what you want.

    Instead of a square grid, you may therefore want to consider a grid or network of nodes all with equal distance, i.e. a hexagonal grid. This will also change the number of neighboring cells but that is the whole point.

    Regarding diffusion: This is a matter of getting the parameters right. Sounds like diffusion per tick was too high. Also it should be in the right proportion relative to the pheromone production by ants. Note that the type of grid also affects diffusion.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build a simple html page which include some text paragraph, during
I'm trying to build simple android project by means of ant. Here is my
I am trying to build simple prototype where I post some text to my
I trying to build a simple lib for persistence with guice persist and some
I just started trying to build simple GUIs because I've always used command-line script
i am trying to build simple php crawler for this purpose i am getting
When trying to build a simple test program that uses atomic operations, I get
I am trying to build a simple script which must be able to navigate
I'm trying to build a simple user setting feature for my school project. I've
I am trying to build a simple custom editor in the Eclipse environment. To

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.