LabVIEW Developers Feature Brainstorming

Showing results for 
Search instead for 
Did you mean: 
Reply

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

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

 

Message 11 of 26 (4,349 Views)

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

Looks like Jack got in before me...

0 Kudos
Message 12 of 26 (4,348 Views)
Reply
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 Smiley Happy.  It feels kind of pleuripotent to me.

0 Kudos
Message 13 of 26 (4,336 Views)
Reply
0 Kudos

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.

Message 14 of 26 (4,327 Views)

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.

Message 15 of 26 (4,313 Views)

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....

0 Kudos
Message 16 of 26 (4,276 Views)
Reply
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
0 Kudos
Message 17 of 26 (4,271 Views)
Reply
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.... 

 

 

0 Kudos
Message 18 of 26 (4,267 Views)
Reply
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. Smiley Wink

 

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.

0 Kudos
Message 19 of 26 (4,231 Views)
Reply
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....

0 Kudos
Message 20 of 26 (3,771 Views)
Reply
0 Kudos