swarm-modeling
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Randomly initializing a N-element vector


From: Sven N. Thommesen
Subject: Re: Randomly initializing a N-element vector
Date: Fri, 08 Oct 1999 15:23:26 -0500

At 12:53 PM 10/8/99 -0700, you wrote:
I need to randomly initialize a N-element vector such that

 (a) every element is between 0 and 1
 (b) the sum of all elements is 1


Umm... give each element a random value between 0.0 and 1.0 (any generator will give you that), then scale (divide) all elements by the sum of the elements drawn?

Sven



                 ==================================
  Swarm-Modelling is for discussion of Simulation and Modelling techniques
  esp. using Swarm.  For list administration needs (esp. [un]subscribing),
  please send a message to <address@hidden> with "help" in the
  body of the message.
                 ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]