[ADMB Users] Compile Error

Armando Mastracci mastracci at gmail.com
Mon Feb 11 07:46:49 PST 2013


Jim,

Yes.  I was just working through that.  I received some help from Mark Fowler.  

It wasn't obvious to me to declare temporary variables in the parameter section by simply removing the init_.  I was under the impression that only optimized parameters went there and init_ was simply a way to initialize them with .pin data.

All is compiling now.  Working through the fact that all my optimized values are NaN.  :-)

Thanks for your help.

On 2013-02-11, at 10:38 AM, "Jim  Bence" <bence at msu.edu> wrote:

> I think the problem is that you define adjusted_pmax in the data section.
> Variables created in the data section should not be calculated as function
> of parameters or variables that change when parameters change.  
> 
> I suspect your problem would go away if you move the line:  
> 
> number adjusted_pmax
> 
> to the PARAMETER_SECTION
> 
> Jim
> 
> -----Original Message-----
> From: users-bounces at admb-project.org [mailto:users-bounces at admb-project.org]
> On Behalf Of Armando Mastracci
> Sent: Monday, February 11, 2013 1:00 AM
> To: users at admb-project.org
> Subject: [ADMB Users] Compile Error
> 
> Brand new to admb.  I've just spent the last 4 hours trying to get past this
> error.  No luck...
> 
> I'm running into compile errors at parts of my code where I assign a
> parameter to a local variable.  "error: cannot convert 'prevariable' to
> 'double' in assignment"
> 
> I've tried using value(param) without luck.
> 
> My parameters have upper and lower bounds.  Here is an excerpt:
> 
> DATA_SECTION 
> <snip>
>  number adjusted_pmax
> 
> PARAMETER_SECTION
>  init_bounded_number pmax(150,700)
>  init_bounded_number pmax_drift(-.2,.2)
> 
> and here is the assignment that is causing the error:
> 
> //calculate adjusted pmax
> 
>    adjusted_pmax = pmax *(1+pmax_drift*(aerobic_capacity -
> aerobic_bal+1)/(aerobic_capacity));
> 
> 
> Am I missing something or is there something else wrong. I'm getting the
> same error both on MacOSX and Linux so likely not something to do with my
> environment.
> 
> Thanks.
> 
> 
> _______________________________________________
> Users mailing list
> Users at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/users
> 




More information about the Users mailing list