Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

You are here: Forum Home → ANT+ Forums → ANT+ Simulation Tools → Thread

   

import function in SimulANT+

Rank

Total Posts: 15

Joined 2012-11-16

PM

Hi,
I'm trying to use the random function in a script for SimulANT+.
Unfortunately when I run the script I get an error as random is not define.

How can import the Random function?

I've tried with other Math functions with the same result.

thanks
     
RankRankRankRank

Total Posts: 120

Joined 2013-05-07

PM

Use the .NET framework:
import clr
from System import Random
randomGenerator 
Random()
randomNumber randomGenerator.Next() 
     
Rank

Total Posts: 15

Joined 2012-11-16

PM

thanks.
it helped me a lot.