As far as I know, you need a seperate file for each
parameter.  So you could have files such as:

GlobalFile_1.GalaxyParameter1   containing
2.56

GlobalFile_1.GalaxyParameter2   containing
1

etc.

Then, you would use the edit parameters window of
the galaxy the parameter values to 

<GlobalFile_1.GalaxyParameter1
<GlobalFile_2.GalaxyParameter2

etc.  Of course, you would have to use valid pathnames
in front of the filenames.

        This probably doesn't help you for what you really want to do.
What I've done in the past when I want a lot of information from
one file is to set the filename as a star parameter then write some
C++ to parse the file.  What you might also try is to create a 
star with a parameter of string type, then set its value to 
"<GlobalFile_1"   I believe this will put the entire contents of the
file into the string, where you can parse it.  I've never tried
this though (it might just read the first line of the file).
        None of this helps setting galaxy parameters because it
only works within a star.  When I run universes using ptcl, I have 
an awk script that goes through and sets universe and galaxy 
parameters beforehand.  Not the prettiest thing in the world, but it
works.
        Hope some of this is helpful.


[EMAIL PROTECTED] writes:
>From: "Madamopoulos, Nicholas" <[EMAIL PROTECTED]>
>Subject: Reading Parameters from a file
>Date: Thu, 25 May 2000 09:21:37 -0400

>Hi
>I am trying to clarify a few things of how to read parameter values
>from a file.  Can someone help me?  I read the description in the
>manual for Ptolemy 0.7 (section 2.4.3) and still haven't accomplished
>my goal.

>Say we have a universe that has a galaxy, and we want its parameters to
>be read from a file called GlobalFile and its path is :
>/home/users/user_name/sub_dir1/GlobalFiles_dir/GlobalFile_1. 

>Say now that the galaxy has the following parameters we want to control:
>GalaxyParameter1 (of float type)
>GalaxyParameter2 (of int type)
>GalaxyParameter3 (of float type)
>GalaxyParameter4 (of intarray type)

>Question1:  Do we set the format of  the GlobalFile as follows?

># Global Parameters
>{GalaxyParameter1} 2.56
>{GalaxyParameter2} 1
>{GalaxyParameter3} 3.02
>{GalaxyParameter4} 0 1 0 1 
># end of file

>where 2.56, 1, 3.02, 0 1 0 1 are the desired values for these
>parameters.


>Question 2: We go to the edit window of the galaxy and we set us values
>of the 4 parameters the following (?)

>*The GlobalFile_1 complete path?
></home/users/user_name/sub_dir1/GlobalFiles_dir/GlobalFile_1
>This does not work.  It gives a Parameter Initialization Error:
>Unexpected token {GalaxyParameter1}

>*If I set the GalaxyParameter1 value as
></home/users/user_name/sub_dir1/GlobalFiles_dir/{GalaxyParameter1}/Globa
>lFile_1
>It gives an Error: of undefined symbol GalaxyParameter1


>*If I specify the GlobalFile as a global parameter first as follows 
>Name: GlobalFile
>Type:  string
>Value: /home/users/user_name/sub_dir1/GlobalFiles_dir/GlobalFile_1

>and try to read the values of the galaxy parameters directly from a
>file by setting the value of the GalaxyParameter1 as 
>GalaxyParameter1:
></home/users/user_name/sub_dir1/GlobalFiles_dir/GlobalFile_1
>It gives an error of : parameter initialization error: unexpected
>token: {GalaxyParameter1}

>Or as the name of the global parameter name in brackets?
>{GlobalFile} 
>It gives an error again.  This does not work since the global file is a
>string and the GalaxyParameters are not string type.

>Any comment is appreciated.

>Regards,
>Nicholas Madamopoulos

>------------------------------------------------------------------------
>----
>Posted to the ptolemy-hackers mailing list.  Please send administrative
>mail for this list to: [EMAIL PROTECTED]


---------------------------------------
Telos Systems -- 2101 Superior Avenue, Cleveland  OH  44114
Phone: 216.241.7225   Fax: 216.241.4103
http://www.zephyr.com   http://www.audioactive.com


----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to