Subcontexts and the context.xml file

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Subcontexts and the context.xml file

Willy Ray-2
I have a hospital model.  

I have a bunch of subcontexts that extend DefaultContext; Facility, Ward, Room.

My builder creates a facility, then I've got a bunch of nested loops building out the rest of the facility. Create the ward, add it w/ addSubContext to the facility.  Loop through the number of rooms per ward, addSubContexting them to the ward.  

In this way, I build a whole hospital.

I've recently figured out how the context.xml file works with setId().  So, I can create a context.xml file that explicitly specifies all the subcontexts I'm spitting out in the builder.  My problem is that I'm going to need to have my facility defined parametrically.  I need to test an intervention in facilities of different sizes and configurations.

I can leave the context.xml file empty, and everything still runs just fine... I just don't see the contexts in the runtime window.  I'm not using any displays at runtime, and I'm using java.util.logging for my data collection... 

My question is this: what do I lose by not having my subcontexts defined in context.xml?  Will I still be able to set projections on a subcontext that's not defined in context.xml?  

Thanks,

Willy

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: Subcontexts and the context.xml file

Tatara, Eric R.

Context and projection information in the context.xml is only used by the GUI scenario tree because this information is otherwise unavailable to the GUI before the ContextBuilder.build() is called, which happens when the Run button is pressed.   If you omit context and projection information from the context.xml, your model code will otherwise run fine.

 

eric

 

From: Willy Ray [mailto:[hidden email]]
Sent: Thursday, February 23, 2017 10:40 AM
To: Repast List <[hidden email]>
Subject: [Repast-interest] Subcontexts and the context.xml file

 

I have a hospital model.  

 

I have a bunch of subcontexts that extend DefaultContext; Facility, Ward, Room.

 

My builder creates a facility, then I've got a bunch of nested loops building out the rest of the facility. Create the ward, add it w/ addSubContext to the facility.  Loop through the number of rooms per ward, addSubContexting them to the ward.  

 

In this way, I build a whole hospital.

 

I've recently figured out how the context.xml file works with setId().  So, I can create a context.xml file that explicitly specifies all the subcontexts I'm spitting out in the builder.  My problem is that I'm going to need to have my facility defined parametrically.  I need to test an intervention in facilities of different sizes and configurations.

 

I can leave the context.xml file empty, and everything still runs just fine... I just don't see the contexts in the runtime window.  I'm not using any displays at runtime, and I'm using java.util.logging for my data collection... 

 

My question is this: what do I lose by not having my subcontexts defined in context.xml?  Will I still be able to set projections on a subcontext that's not defined in context.xml?  

 

Thanks,

 

Willy


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest