RightEdge Forums
Main     Home          Members     Calendar     Who's On

Welcome Guest
        



optimization parameters in code Expand / Collapse
Message
Posted 7/10/2010 12:03:58 Post #11927
 

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member
I get adding parameters through the UI, then referencing them in code; I'm a little fuzzy on where the SystemParameters class resides; I'm not big on behind the scenes magic I can't control from code.

My question is this: can I declare an optimization parameter in code, or do I always need to use the UI to add a parameter before referencing it in code?

SystemParameters.Keys.Add("test34");

I seem to be able to add a key to the collection (in system startup), but once done I don't seem to be able to set initial values. And perhaps more to the point the new parameter does not show in the UI after I have compiled the system.
Posted 7/12/2010 11:31:18 Post #11936
 

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member


I've been thinking about this a bit more; If I understand the way RE handles parameters it will be a significant pain. Here is what I would like to see in RE:


1) the ability to add a new systemParameterInfo item to the SystemParameters collection in code
2) the ability to set a default (non-optimization) value in the item.SystemParameterInfo item
3) (after compile) have the new item and default value appear in the UI

I realize this requires some plumbing to achieve.
Posted 7/12/2010 11:53:18 Post #11937
 

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member
Okay. I think I have a workaround to achieve what I want.

1) declare a MySystemParameters dictionary in MySystem
2) set initial runtime values in MySystemParameters("myKey").value
3) at runtime, access the SystemParameter of the same name
a) if the optimization parameter exists in SystemParameter (and the value is != 0), use its Value
b) if the SystemParameter does not yet exist, use the default value in MySystemParameter

Caveat: once you establish the parameter in the UI, any non-zero default value set in the UI will override the default value set in your code.


Posted 7/12/2010 13:45:02 Post #11941
 

Lead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead Developer
There really is no magic in the system parameters. It's simply a convenient way to move parameters from UI to code without having to code. If you want to override this completely, that's fine.

What you're proposing would be fine.

DTrader (7/12/2010)
Okay. I think I have a workaround to achieve what I want.

1) declare a MySystemParameters dictionary in MySystem
2) set initial runtime values in MySystemParameters("myKey").value
3) at runtime, access the SystemParameter of the same name
a) if the optimization parameter exists in SystemParameter (and the value is != 0), use its Value
b) if the SystemParameter does not yet exist, use the default value in MySystemParameter

Caveat: once you establish the parameter in the UI, any non-zero default value set in the UI will override the default value set in your code.


« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: billb, young, dplaisted

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 4:39pm

2005-2007 © RightEdge Systems