Hive

From Simulace.info
Revision as of 17:41, 13 January 2013 by Xseda07 (talk | contribs) (Results)
Jump to: navigation, search
  • Project name: Hive
  • Class: 4IT495 Simulation of Systems (WS 2012/2013)
  • Author: Adam Sedláček
  • Model type: Agent-based simulation
  • Software used: NetLogo 5.0.2

Problem Definition

As is known, the hive is a community that is very complex and is influenced by both internal and external factors. Also it is said, that hive is the only working communist and feminist community in the world. Therefore,the simulation was created to examine the influence of internal and external circumstances which influence the hive and the ecosystem in which they live. Especially I mean these factors:

  • Number and distance of flowers to pollinate
  • Number of workers and drones in the hive
  • How duration of winter affect stocks of honey and colony survival
  • How number of workers affect pollination of flowers and therefore the number of flowers in neighborhood.

The goal of this hive simulation is to understand the dependencies among factors listed above.

Method

Because of hive is multiagent system, NetLogo 5.0.2 is used for this simulation. NetLogo is powerful tool and is easy to learn. But it has also disadvantages. For example low speed and performance.

Only standard NetLogo procedures and features was used, except some turtle´s shapes, which was created by author.

To understand dependencies of individual factors, lot of data is needed. The results presented in this page comes from many repetitions of simulation with many different settings of model variables.

Model

As it was said, hive is very complex community and it´s behavior is also very complicated. Therefore the model is simplified to be able get reasonable results at reasonable time. Although many real values of the variables are used in the model.

Model behavior

This model tries to imitate behavior of the hive and surrounding areas with flowers, including changing of day and night and season.

Model environment

In the model the world is a square with edge dimension of 200 patches. Bees can move and flowers grow in a space of 200 * 150 patches. The rest 50 patches are reserved for sky and the Sun. The world doesn't wrap horizontally and vertically, so it is not possible to move from one edge to opposite one in one step.

Next sub-chapters describing behavior of individual parts of the model and we can distinguish these agents:

Sun

The Sun is not only visual element in the model, but it also determines behavior of the hive. When sun is beyond the horizon, bees are in the beehive. If Sun is on the sky, than new day begins and bees start to fly. How long the day is depends on how fast Sun goes across the sky.

Flowers

Flowers are important part of the model. They give food for bees. Every unpollinated flower is red and has variable nectar, which determines amount of nectar in the flower. It is defined as random number from 1 to 10. If variable nectar = 0, than flower is pollinated and it is ready to proliferate. There is also variable, which says how long does it take to new flowers grow. If this time is reached, than new flower grow in the von Neumann neighborhood of the pollinated flower which has orange color. Flowers also have variable age. (At the beginning of the simulation defined as random number from 0 to the value of variable, which defines how long flower lives before it dies.) If flower is not pollinated, than according to it´s age dies. (Dead flower has brown color.)

Beehive

Beehive is a "home" of bees, including workers, drones and queen. Also bee´s larvae (eggs in model)growing in the beehive. In the beehive are situated provisions of honey which is consumed by bees, when they are hungry. Bees are hidden here during the night and winter.

Beehive is randomly situated on the grass in the model or is in the middle of the grass(depending on settings).

Workers

Workers are female bees which are responsible for pollinating the flowers and collecting the nectar. They fly random direction in the morning to find flowers. If they find them, they pollinate it and collect nectar. Every worker can collect only 3 mg (milligrams) from each flower in a row, then she moves and looking for another flower. When worker has 30 mg of nectar, then she returns to the beehive. If the worker is very close to beehive and has found the flower, then she tells other workers in the beehive direction of the flower and they fly this direction. If worker didn't find anything, then it returns to the beehive.

Every worker consumes honey in the beehive. Worker consumes 4.5 mg of honey (nectar) a day (in the night and winter consumes a half). At the beginning of the simulation the value of energy is set for every worker to her maximum level. Maximum level of energy is defined as random-normal distribution, mean 22, standard deviation 2.5. This value describes how long can worker life without food. If variable energy = 0, then worker dies. If the value of energy is less than 5, than worker moves back to beehive for honey and if there is enough honey, then sets energy to the maximum energy.

Workers has also age, which is set at the beginning of the simulation. The value of age is defined for each worker as random number from 0 to 40. If age is > 50 in the summer or > 180 in the winter, worker dies.

Drones

Drones are male bees which are responsible for fertilization of the queen´s eggs. They fly random direction and when they meet queen, they fertilize her and than die. If they don´t meet her, they fly back to the beehive and than fly random direction out of the beehive again.

In case of honey consumption it is the same as workers except their max energy value, which is defined as random normal distribution, mean 18, sd 2.5. Just as workers, drones has age set and defined same as workers, except winter. This is because drones are expelled from beehive and the community at the beginning of the winter.

Queen

Queen is a female bee which is sexually mature and it is mother of all bees in the hive. She is responsible for laying eggs. Queen flies random direction and oviposits every two days if she is in the beehive. She needs to mate with at last six drones to be fertilized. If she is fertilized then she oviposits "worker´s" eggs. If she is not, she oviposits "drone´s" eggs.

Just as workers and drones, queen has variable energy and max energy value is defined as random normal distribution, mean 100, sd 2. This difference is because of the fact that queen is preferred in honey allocation. That means, that queen is the last one who suffer from lack of honey in the beehive. In case of honey consumption, queen consumes 1.5 times more every day than worker/drone. Unlike workers and drones, queen lives much longer. In simulation it is 1000 days. There is always only one queen in the model.

Eggs

There are two types of the eggs in the model. The first one is the "worker´s" egg and the second one is "drone´s egg". Their attributes are the same, but from "worker´s" eggs can hatch only workers and from drone´s ones only drones. Eggs consume the same amount of honey as mature worker/drone. Same as others, eggs has value of energy and maximum energy. Value of maximum energy is defined as random normal distribution, mean 15 st 2. Every egg has variable age. When it´s age reach 21 days, new worker/drone is hatched and egg "dies"

Variables of the model

Patches

  • pollinated - true/false, if true, than flower is pollinated
  • nectar - current quantity of nectar in the flower
  • old - flower´s age at the beginning of the simulation
  • howold - current age
  • time-to-grow - support variable that says how much time passed since pollination

Workers

  • nectar-worker- current quantity of nectar collected
  • old-worker - worker´s age at the beginning of the simulation
  • howold-worker - current age
  • direction - direction from beehive to flower if she found any
  • is-flower - true/false, if true, than worker found flower
  • energy - current amount of energy left
  • max-energy - maximum energy of worker
  • ch - support variable
  • tell - support variable, values 1/2/3, if worker said to the other worker direction of flowers, than this variable = 2, if worker was told, where flowers are, than tell= 1. Otherwise 3

Drones

  • old-drone - drone´s age at the beginning of the simulation
  • howold-drone - current age
  • energy - current amount of energy left
  • max-energy - maximum energy of drone
  • ch - support variable

Queen

  • old-queen - queen´s age at the beginning of the simulation
  • howold-queen - current age
  • energy - current amount of energy left
  • max-energy - maximum energy of queen
  • ch - support variable
  • num-of-fertilization - current quantity of fertilization

Eggs

  • old-egg - day when egg arises
  • howold-egg - current age
  • energy - current amount of energy left
  • max-energy - maximum energy of egg
  • ch - support variable
  • workr -true/false, if true, than egg is "worker´s egg"
  • dron-true/false, if true, than egg is "drone´s egg"

User interface and controls

Interface.png

User interface of the simulation consists of three parts. The first one is Animation box in which the visualization of simulation is showed. The second part are controls, which enable to control and set the parameters of the simulation. The third part of user interface consists of plots and monitors, where values of selected variables are displayed.

Controls

Buttons

  • setup- setups the simulation and variables at selected values
  • go- runs and stops the simulation

Sliders and switches

  • daytime- if switched on, then visualization of day/night is enabled
  • control-winter-if switched on, then beginning/end of winter is set manually
  • set-winter- works only when control-winter is on, if switched on, then winter mode is activated
  • real-days-if switched on, then Sun moves across the sky and changing of day/night is activated
  • flowers-percent-unit if switched on, then slider number-of-flowers sets amount of flowers as % of number of green patches(grass)
  • beehive-fixed-position- if switched on, beehive is situated in the middle of the grass, otherwise is placed randomly
  • speed- works only when real-days is on, changes the speed of moving sun -> length of day
  • flower-size - changes size of flowers (the number set is radius of the circle in which are flowers placed at the beginning of simulation)
  • time-to-live-flowers- changes how long will flowers live (days)
  • set-time-to-grow- changes how long it takes before new flowers are made from pollinated one (days)
  • how-much-eat- changes how much honey bees eat every day (mg)
  • how-long-winter- changes length of winter (days)
  • how-long-day- works only if real-days is off, changes day length (ticks)
  • num-of-flowers- changes number of flowers (number, if flowers-percent-unit is off, otherwise is defined as % of number of green patches )
  • num-of-workers- changes number of workers in the model
  • num-of-drones- changes number of drones in the model
  • num-of-eggs- changes number of eggs that queen lays at one time
  • distance-from-beehive- changes minimum distance from beehive, where flowers could be placed at the beginning of the simulation(radius)

Plots and monitors

  • honey - shows amount of honey stored in beehive in mg
  • number of workers/drones/eggs - shows number of workers, drones and eggs in the model
  • flowers - shows number of flowers and average distance of flowers from hive
  • day - this monitor shows current day number
  • eggs workers - this monitor shows current number of "worker´s egg"
  • eggs drones - this monitor shows current number of "drone´s egg"
  • fertilized - this monitor shows whether queen is fertilized at the moment"

Limitations of the model

In real life, things are more complicated. For example there is about 20 000 - 50 000 bees in hive. Not every worker collect nectar, there could be more than one queen in the hive and so on. Also many different flowers grow in the meadow... These and many other aspect can´t be simply implemented because of computational complexity. So this model shows basic dependencies and influences between hive and environment in which bees live.

Results

Model can run in two different modes. First mode could be called "real mode", because of changing day and night and season. This mode is more complicated to analyze due to huge amount of data. It is because of the simulation runs about 250 000 ticks, so it is very time consuming. But it showed, that to discover some dependencies, switching day/night and season is not needed. Due to this finding, second mode was crated, in which day length can be set in ticks and sun is always in the Sky.

Because of getting much data and results from simulation runs, I will present only important dependencies and influences which arise in the model.

Next results are from simulation which has these variable values:

How day length / number of workers at the beginning/ flower size affect stock of honey

Stock of honey.png

These two graphs show how day length, number of workers at the beginning of the simulation and flower size affect stock of honey.

How length of winter and amount of flowers/workers/drones affects the stock of honey

Conclusion

Source Code