Re: Re: Could some body help please ?

José A Martín H <[email protected]> Mon, 6 Sep 2004 17:59:55 +0200
Newsgroups gmane.comp.cybernetics.webot.contest
Message-ID <000b01c4942a$8e49e040$ad226750@CASA>
Yes, i know that. this is not the problem.

but by now, i hace deciden to not use this class any more, the library seems to be unstable...
so i have codified my own version of the class.

thanks for help.
  ----- Original Message ----- 
  From: Cosmin Dancu 
  To: [email protected] 
  Sent: Monday, September 06, 2004 1:55 PM
  Subject: [webots-contest] Re: Could some body help please ?


  Hi,

  The statement below creates an array of arrays and *not* the 
  NormalDistribution objects. 

  >           Probs= new NormalDistribution[11][94];

  All references in Probs array are null and improper use will cause a 
  NullPointerException.

  In order to initialize the array you have to create the objects like 
  this:

    NormalDistribution[][] Probs;
    Probs = new NormalDistribution[11][94];
    for(int i = 0; i < 11; ++i) {
      for(int j = 0; j < 94; ++j) {
        Probs[i][j] = new NormalDistribution();
      }
    }

  Cosmin.

  --- In [email protected], "joseoomartin" 
  <joseamartin@c...> wrote:
  > I am using the library Jsci.
  > 
  > there is a class NormalDistribution.
  > 
  > but if i try to initialize the size of the array, webots aborts the
  > robot controller with out any possibility of reading any error.
  > 
  > I have proved this class outside webots and this instruction works 
  well
  > 
  >           Probs= new NormalDistribution[11][94];
  > 
  > but if i write this intruction on webots, the robot controller is
  > aborted, and no chance of catching any expeption is possible.
  > 
  > Could some body help ?...
  > 
  > Thanks...


        Yahoo! Groups Sponsor 
              ADVERTISEMENT
             
       
       


------------------------------------------------------------------------------
  Yahoo! Groups Links

    a.. To visit your group on the web, go to:
    http://groups.yahoo.com/group/webots-contest/
      
    b.. To unsubscribe from this group, send an email to:
    [email protected]
      
    c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.