WorldViz User Forum

WorldViz User Forum (
-   Vizard (
-   -   Array Question (

new_horizon 12-11-2012 04:32 AM

Array Question
Hi All,

I am trying to create a program whereby an element is selected from an array and then a new array (minus the selected object is then created).


Speed = [30,40,50,60]

target_speed = random.choice(Speed)

Speed = Speed-target_speed

Obviously the last line is incorrect - can anyone suggest how this can be done?


new_horizon 12-11-2012 05:20 AM

Solved the issue - for anyone who wants to know for the future...


                No_probe_vehicle = 20 # number of trials
                Speedarray = ([30,30,30,30,40,40,40,40,50,50,50,50,60,60,60,60])

                for j in range (0,No_probe_vehicle):

                        probe_speed = random.choice(Speedarray)
                        Speed[1] = probe_speed*(1609.44/3600)
                        print "Probe Speed", probe_speed
                        print "Speed Array", Speedarray
                        print "speed", Speed

All times are GMT -7. The time now is 11:05 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC