Initializing help system before first use

XPRMgetattr

XPRMgetattr


Purpose
Get an attribute of an entity.
Synopsis
int XPRMgetattr(XPRMmodel model, XPRMattrdesc attrdesc, void *ref, XPRMalltypes *value);
Arguments
model 
Reference to a model
attrdesc 
An attribute descriptor
ref 
An entity of the type associated to the attribute
value 
Pointer to an area where the value of the attribute is returned
Return value
Type number of the returned value or 0 in case of error.
Example
The following example displays the reduced cost of variable x.
XPRMalltypes x,rcost;
XPRMattrdesc getrcost;
XPRMfindident(model,"x",&x);
getrcost=XPRMfindattrdesc(model,XPRM_TYP_MPVAR,"rcost");
XPRMgetattr(model,getrcost,x.ref,&rcost);
printf("getrcost(x)=%g\n",rcost.real);
Further information
1. This function makes it possible to retrieve an attribute of an entity using a type descriptor as returned by XPRMfindattrdesc.
2. The internal list of types attributes is deleted each time the model is run or reset: descriptors obtained before a model execution should not be used after the model has been run.
Related topics

© 2001-2020 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.