[ADMB Users] Compile Error

Jim Bence bence at msu.edu
Mon Feb 11 07:38:52 PST 2013


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