Quantcast
Channel: Rhino Developer - McNeel Forum
Viewing all articles
Browse latest Browse all 8556

C# Random remove when coming closer to a target number

$
0
0

I have a list of numbers. With C# I want to remove the numbers gradually randomly when numbers come closer to a target number.

I now how to do something with a target number in Python

def randomIntegerVa(startVa,endVa,targetVa=None):
    if targetVa!=None:
        randomIntegerVa=round(r.triangular(startVa,endVa,targetVa))
    else:
        randomIntegerVa=r.randint(startVa,endVa)
    return randomIntegerVa

I was thinking about something with divide or the remainder to increase the change a number is removed. But that does not sound that smart because it has nothing to do with ‘randomness.’

Maybe I should first remap-ly randomly remove.

A. Remove randomly x-amount of items.
B. Increase change of removal when closer to target number.

1# Question:
Is MathNet a thing in C#?

It does not seem like it.
I entered ‘using MathNet;’

5 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 8556

Trending Articles