How to determine whether program is running in Robotstudio simulation or in the actual manipulator?

If it is desired to set different parameters (such as motion speed) for a program based on the condition of whether program is running in Robotstudio simulation or in the actual manipulator, how can this be programmatically achieved?

http://developercenter.robotstudio.com/BlobProxy/manuals/RapidIFDTechRefManual/doc383.html