NI Home > Community > NI Discussion Forums

LabVIEW Developers Feature Brainstorming

Reply
Active Participant
GregS
Posts: 560

Re: Now available for download: "Randomize 1D Array.vi" that accepts any array type

Hate to criticize this superb effort, but it appears that the order is not a uniform distribution - this test shows that of an array with 10 elements ordered 0..9, the "randomized" first element is 9 ~90% of the time, and 0 the other ~10%.  Similarly, 8 is most often found in positions 2 and 10, 7 in 3 and 9, etc.

17399iDE0CB2A9F0364FF9

 

Active Participant
GregS
Posts: 560
0 Kudos

Re: Now available for download: "Randomize 1D Array.vi" that accepts any array type

Looks like Jack got in before me...

Member
justin.goeres
Posts: 20
0 Kudos

Re: Now available for download: "Randomize 1D Array.vi" that accepts any array type

[ Edited ]

 


Aristos Queue wrote:

At the moment, we call this kind of VI a "generic VI", because the terms "template VI" and "polymorphic VI" are already taken by other features. "Generic" doesn't really say anything about what this kind of VI actually does, so if anyone has a better suggestion for these types of VIs, post them here. Keep in mind: it will be multiple versions of LV before this feature sees the light of day.


What about any of "{Totipotent, Pleuripotent, Multipotent, Oligopotent} VI?"

 

I leave it to AQ to decide which degree of potential is most descriptive :smileyhappy:.  It feels kind of pleuripotent to me.

Trusted Enthusiast
Darin.K
Posts: 3,859

Re: Now available for download: "Randomize 1D Array.vi" that accepts any array type

I guess that Riffle is not being used under the hood.

Trusted Enthusiast
AristosQueue
Posts: 3,205

Re: Now available for download: "Randomize 1D Array.vi" that accepts any array type

[ Edited ]

Argh. I thought I put the VI together correctly. Yes, it has a bias. Here's the corrected version. And a test VI to prove the distribution is right.

I'll ask a moderator to correct the original post so that future downloads are correct.

Knight of NI
altenbach
Posts: 26,855
0 Kudos

Re: Now available for download: "Randomize 1D Array.vi" that accepts any array type

 


Aristos Queue wrote:

 Here's the corrected version. And a test VI to prove the distribution is right.


 

 

Unless n=0 or 1, the first element of x/y is inf in my testing. Does not look right....


LabVIEW Champion . Do more with less code and in less time .

Trusted Enthusiast
JackDunaway
Posts: 2,572
0 Kudos

Re: Now available for download: "Randomize 1D Array.vi" that accepts any array type

altenbach, you sure you're running the more recent Randomize version, i.e., the 9.04kB version as opposed to the 8.79kB version? I thought for a moment I confirmed your Inf concerns, but after ensuring I had the right version and restarting LabVIEW (including exiting GSW) the probability distribution looked correct and uniform (you're going to see the Inf problem with the old version).

Wirebird Labs: Expert Toolkits for LabVIEWDeploy, by Wirebird Labs: Expert Toolkits for LabVIEW
Knight of NI
altenbach
Posts: 26,855
0 Kudos

Re: Now available for download: "Randomize 1D Array.vi" that accepts any array type

Yes, you are right, it's all good.

 

While I did first open the new subVI straight from the browser, it actually became Randomize1DArray(1).vi in the download folder, while the original was still in there, dormant from earlier, with the right name randomize2DArray.vi.

 

When I then run the opened the Distribution.vi from the browser, it found the old version in the download folder.... 

 

 


LabVIEW Champion . Do more with less code and in less time .

Knight of NI
altenbach
Posts: 26,855
0 Kudos

Re: Now available for download: "Randomize 1D Array.vi" that accepts any array type

[ Edited ]

Interestingly, no matter what the downloaded file is called, the VI shows as Randomize 1D array.vi in the context help and in the title bar of the opened subVI.

 

For example, if I rename the subVI to alphabetagamma.vi, the context help looks as follows.

 

 

 

So, hovering over the VI, the context help shows the same name on top as the windows title of the only open subVI, even though the file names are not the same. Oh well, I need to be more careful when opening VIs directly from within the browser and also pay attention to the second line in the context help. :smileywink:

 

I guess since the VI is in run mode (passworded), we see the custom windows title instead of the actual file name and this threw me off.


LabVIEW Champion . Do more with less code and in less time .

Member WG-
Member
WG-
Posts: 187
0 Kudos

Re: Now available for download: "Randomize 1D Array.vi" that accepts any array type

http://en.wikipedia.org/wiki/Generic_programming

 

Generic should be the name of this kind of VI's.

 

Also I would beg NI to implement this feature as soon as possible (not that we have to wait for 2 years) because this feature would give a infinity number of new applications, http://forums.ni.com/t5/LabVIEW-Idea-Exchange/GOOP-Need-a-new-kind-of-quot-variant-quot-for-inherite....