question

Gabriel Illescas avatar image
0 Likes"
Gabriel Illescas asked Jason Lightfoot commented

How are the A* heat map colors calculated?

FlexSim 19.1.1
astar navigatorheat map
· 5
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joshua S avatar image Joshua S commented ·

You already asked this question. Can you give a specific case or model that you would like help with?

0 Likes 0 ·
Gabriel Illescas avatar image Gabriel Illescas commented ·

My point is,

How can I know the utilization for specific areas or zones?

Each color represent specific utilization percentage?

Please can you tell me again the math logic for each color code?

0 Likes 0 ·
Joshua S avatar image Joshua S Gabriel Illescas commented ·

There isn't a set color correlation to amount of utilization, the closer it is to red, the more utilized it is. If you are looking for exact numbers, either use the data of the heat map that I shared in your last post, or find another way to track the usage of an area. The heat map is more of a helpful visual tool.

0 Likes 0 ·
jacopo-r avatar image jacopo-r commented ·

Hi, I would like to read the content of this post and its answer but I am not able to visualize anything. Is it a bug or can someone explain me why? Thanks

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ jacopo-r commented ·

Until there's an AnswerHub fix for their sites (it's a known, new bug with their service) here's a copy of Matthew's answer:


Here is the logic we are currently using to determine the color of each node of the A* grid when we draw the heat map.

First we calculate a weight value based off the mode the user selects:

// Traversals Per Time
weight = traversals / statisticaltime();

// Average Blockage Time per Traversal
weight = totalBlockedTime / max(1, traversals);

// Percent of Total Time Blocked
weight = 100.0 * totalBlockedTime / statisticaltime();

// Percent of Total Traversals
weight = 100.0 * traversals / heatMapTotalTraversals;

Then we divide that weight value by the Max Heat Value the user specifies:

weight /= navigator->maxHeatValue;
weight = max(0, weight);
weight = min(0.9999, weight);

We now have a number between 0 and 1. Now we multiply this number by the number of colors in our color progression to figure out what color to paint.

double progressionFactor = (double)(heatMapColorProgression.size() - 1) * weight;
Vec4f lowColor = heatMapColorProgression[(int)floor(progressionFactor)];
Vec4f highColor = heatMapColorProgression[(int)ceil(progressionFactor)];
Vec4f color = lowColor + ((highColor - lowColor) * frac(progressionFactor));

And for reference these are the color progression colors:

std::vector<Vec4f> AStarNavigator::heatMapColorProgression =
{
Vec4f(0.110f, 0.280f, 0.467f, 1.0f),
Vec4f(0.106f, 0.541f, 0.353f, 1.0f),
Vec4f(0.984f, 0.690f, 0.129f, 1.0f),
Vec4f(0.964f, 0.533f, 0.220f, 1.0f),
Vec4f(0.933f, 0.243f, 0.196f, 1.0f)
};
0 Likes 0 ·

1 Answer

Matthew Gillespie avatar image
4 Likes"
Matthew Gillespie answered Matthew Gillespie commented

Here is the logic we are currently using to determine the color of each node of the A* grid when we draw the heat map.

First we calculate a weight value based off the mode the user selects:

// Traversals Per Time
weight = traversals / statisticaltime();

// Average Blockage Time per Traversal
weight = totalBlockedTime / max(1, traversals);

// Percent of Total Time Blocked
weight = 100.0 * totalBlockedTime / statisticaltime();

// Percent of Total Traversals
weight = 100.0 * traversals / heatMapTotalTraversals;

Then we divide that weight value by the Max Heat Value the user specifies:

weight /= navigator->maxHeatValue;
weight = max(0, weight);
weight = min(0.9999, weight);

We now have a number between 0 and 1. Now we multiply this number by the number of colors in our color progression to figure out what color to paint.

double progressionFactor = (double)(heatMapColorProgression.size() - 1) * weight;
Vec4f lowColor = heatMapColorProgression[(int)floor(progressionFactor)];
Vec4f highColor = heatMapColorProgression[(int)ceil(progressionFactor)];
Vec4f color = lowColor + ((highColor - lowColor) * frac(progressionFactor));<br>

And for reference these are the color progression colors:

std::vector<Vec4f> AStarNavigator::heatMapColorProgression =
{
	Vec4f(0.110f, 0.280f, 0.467f, 1.0f),
	Vec4f(0.106f, 0.541f, 0.353f, 1.0f),
	Vec4f(0.984f, 0.690f, 0.129f, 1.0f),
	Vec4f(0.964f, 0.533f, 0.220f, 1.0f),
	Vec4f(0.933f, 0.243f, 0.196f, 1.0f)
};

· 10
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Gabriel Illescas avatar image Gabriel Illescas commented ·

What does it mean heatmaptotaltraversals?

heatmaptotaltraversals = heat map value * total traversals ?

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Gabriel Illescas commented ·

heatmaptotaltraversals is the total number of traversals on that grid. So if a person travels across two grid nodes each node will have 1 traversal, but heatmaptotaltraversals will be 2.

0 Likes 0 ·
Gabriel Illescas avatar image Gabriel Illescas commented ·

What does it mean max heat value? represent the tracking period time or something?

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Gabriel Illescas commented ·

Max Heat Value is a number that you choose. It represents the value of "maximum" heat or bright red.

So in this example a red spot on the heat map would mean that node had 0.1 traversals per model time unit or more.

0 Likes 0 ·
maxheat.png (12.5 KiB)
Gabriel Illescas avatar image Gabriel Illescas Matthew Gillespie ♦♦ commented ·

So when you say model time unit is equal to:

Traversals = (max heat value)*(time())

could be?

0 Likes 0 ·
Show more comments
Show more comments