Local variables – ShiVa Engine

Local variables

In ShiVa, we use the term Member Variable to describe a function like this.myValue () that you previously defined in your AI Model Editor. If you are hunting for performance, keep in mind that that every () you use is a function call.

local iStep == this.nStep ( )
if     iStep == 0 then
elseif iStep == 1 then
elseif iStep == 2 then
(...)
elseif iStep == 99 then
elseif iStep == 100 then
end
The snippet above 100x faster than the next one:
if     this.nStep ( )== 0 then
elseif this.nStep ( )== 1 then
elseif this.nStep ( )== 2 then
(...)
elseif this.nStep ( )== 99 then
elseif this.nStep ( )== 100 then
end



Need more answers?

  • slackBanner