Trouble adding a subContext. Do we still have to register it in a ".score" file?

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

Trouble adding a subContext. Do we still have to register it in a ".score" file?

Willy Ray-2
I have a room with some zones.  

Room and Zone both extend DefaultContext

public Context build(Context<Object> context) {

     // TODO Auto-generated method stub


     room = new Room<Object>();

     context = room;

     Zone<Object> z0 = new Zone<Object>(0);

     room.addSubContext(z0);

...

}


This fails with "repast.simphony.engine.controller.DefaultController - Unable to initialize a subcontext: check that subcontext constructors are passed the correct name"

The only mailing list responses I can find refer to adding the subcontexts in the .score file, but I think that's deprecated, right?  How do I set up a subContext under Repast Simp. 2.3?


Thanks,


Willy






------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: Trouble adding a subContext. Do we still have to register it in a ".score" file?

srcnick
You don’t have to register it in the score file as that no longer exists, but you do need to add it to the context.xml as a nested context element in the context.xml

On Nov 3, 2016, at 11:41 AM, Willy Ray <[hidden email]> wrote:

I have a room with some zones.  

Room and Zone both extend DefaultContext

public Context build(Context<Object> context) {

     // TODO Auto-generated method stub


     room = new Room<Object>();

     context = room;

     Zone<Object> z0 = new Zone<Object>(0);

     room.addSubContext(z0);

...

}


This fails with "repast.simphony.engine.controller.DefaultController - Unable to initialize a subcontext: check that subcontext constructors are passed the correct name"

The only mailing list responses I can find refer to adding the subcontexts in the .score file, but I think that's deprecated, right?  How do I set up a subContext under Repast Simp. 2.3?


Thanks,


Willy





------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: Trouble adding a subContext. Do we still have to register it in a ".score" file?

Willy Ray-2
I'm not finding the documentation for that.  My google-fu is weak, I guess.  Is it in the documentation somewhere?

On Fri, Nov 4, 2016 at 7:08 AM, Nick Collier <[hidden email]> wrote:
You don’t have to register it in the score file as that no longer exists, but you do need to add it to the context.xml as a nested context element in the context.xml

On Nov 3, 2016, at 11:41 AM, Willy Ray <[hidden email]> wrote:

I have a room with some zones.  

Room and Zone both extend DefaultContext

public Context build(Context<Object> context) {

     // TODO Auto-generated method stub


     room = new Room<Object>();

     context = room;

     Zone<Object> z0 = new Zone<Object>(0);

     room.addSubContext(z0);

...

}


This fails with "repast.simphony.engine.controller.DefaultController - Unable to initialize a subcontext: check that subcontext constructors are passed the correct name"

The only mailing list responses I can find refer to adding the subcontexts in the .score file, but I think that's deprecated, right?  How do I set up a subContext under Repast Simp. 2.3?


Thanks,


Willy





------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest



------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: Trouble adding a subContext. Do we still have to register it in a ".score" file?

srcnick
In the context.xml, your master context will look somethine like:

<context id="jzombies"
xsi:noNamespaceSchemaLocation="http://repast.org/scenario/context">
<projection type="continuous space" id="space"></projection>
<projection type="grid" id="grid"></projection>
<projection type="network" id="infection network"></projection>

</context>

Adding a subcontext to that is just a matter for adding an additional <context> element in side that.

<context id="jzombies"
xsi:noNamespaceSchemaLocation="http://repast.org/scenario/context">
<projection type="continuous space" id="space"></projection>
<projection type="grid" id="grid"></projection>
<projection type="network" id="infection network"></projection>

<context id=“jz_sub_context">
</context>
</context>


On Nov 4, 2016, at 9:27 AM, Willy Ray <[hidden email]> wrote:

I'm not finding the documentation for that.  My google-fu is weak, I guess.  Is it in the documentation somewhere?

On Fri, Nov 4, 2016 at 7:08 AM, Nick Collier <[hidden email]> wrote:
You don’t have to register it in the score file as that no longer exists, but you do need to add it to the context.xml as a nested context element in the context.xml

On Nov 3, 2016, at 11:41 AM, Willy Ray <[hidden email]> wrote:

I have a room with some zones.  

Room and Zone both extend DefaultContext

public Context build(Context<Object> context) {

     // TODO Auto-generated method stub


     room = new Room<Object>();

     context = room;

     Zone<Object> z0 = new Zone<Object>(0);

     room.addSubContext(z0);

...

}


This fails with "repast.simphony.engine.controller.DefaultController - Unable to initialize a subcontext: check that subcontext constructors are passed the correct name"

The only mailing list responses I can find refer to adding the subcontexts in the .score file, but I think that's deprecated, right?  How do I set up a subContext under Repast Simp. 2.3?


Thanks,


Willy





------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest




------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: Trouble adding a subContext. Do we still have to register it in a ".score" file?

Willy Ray-2
how does the id of the subcontext relate to the class of the subcontext?  If I have a Room context with a Zone context, how do the Zones get mapped to the subcontext listed in the context.xml file?  Do I have to do "setId()" on them?  

Thanks.

On Fri, Nov 4, 2016 at 9:50 AM, Nick Collier <[hidden email]> wrote:
In the context.xml, your master context will look somethine like:

<context id="jzombies"
xsi:noNamespaceSchemaLocation="http://repast.org/scenario/context">
<projection type="continuous space" id="space"></projection>
<projection type="grid" id="grid"></projection>
<projection type="network" id="infection network"></projection>

</context>

Adding a subcontext to that is just a matter for adding an additional <context> element in side that.

<context id="jzombies"
xsi:noNamespaceSchemaLocation="http://repast.org/scenario/context">
<projection type="continuous space" id="space"></projection>
<projection type="grid" id="grid"></projection>
<projection type="network" id="infection network"></projection>

<context id=“jz_sub_context">
</context>
</context>


On Nov 4, 2016, at 9:27 AM, Willy Ray <[hidden email]> wrote:

I'm not finding the documentation for that.  My google-fu is weak, I guess.  Is it in the documentation somewhere?

On Fri, Nov 4, 2016 at 7:08 AM, Nick Collier <[hidden email]> wrote:
You don’t have to register it in the score file as that no longer exists, but you do need to add it to the context.xml as a nested context element in the context.xml

On Nov 3, 2016, at 11:41 AM, Willy Ray <[hidden email]> wrote:

I have a room with some zones.  

Room and Zone both extend DefaultContext

public Context build(Context<Object> context) {

     // TODO Auto-generated method stub


     room = new Room<Object>();

     context = room;

     Zone<Object> z0 = new Zone<Object>(0);

     room.addSubContext(z0);

...

}


This fails with "repast.simphony.engine.controller.DefaultController - Unable to initialize a subcontext: check that subcontext constructors are passed the correct name"

The only mailing list responses I can find refer to adding the subcontexts in the .score file, but I think that's deprecated, right?  How do I set up a subContext under Repast Simp. 2.3?


Thanks,


Willy





------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest





------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: Trouble adding a subContext. Do we still have to register it in a ".score" file?

srcnick
I haven’t done this in a while, but I think in cases where you may have multiple subcontexts of the same class, you can set a type on them with setType() (e.g. setType(“room”) and then use the type string in the context.xml.

Nick

On Nov 10, 2016, at 11:38 AM, Willy Ray <[hidden email]> wrote:

how does the id of the subcontext relate to the class of the subcontext?  If I have a Room context with a Zone context, how do the Zones get mapped to the subcontext listed in the context.xml file?  Do I have to do "setId()" on them?  

Thanks.

On Fri, Nov 4, 2016 at 9:50 AM, Nick Collier <[hidden email]> wrote:
In the context.xml, your master context will look somethine like:

<context id="jzombies"
xsi:noNamespaceSchemaLocation="http://repast.org/scenario/context">
<projection type="continuous space" id="space"></projection>
<projection type="grid" id="grid"></projection>
<projection type="network" id="infection network"></projection>

</context>

Adding a subcontext to that is just a matter for adding an additional <context> element in side that.

<context id="jzombies"
xsi:noNamespaceSchemaLocation="http://repast.org/scenario/context">
<projection type="continuous space" id="space"></projection>
<projection type="grid" id="grid"></projection>
<projection type="network" id="infection network"></projection>

<context id=“jz_sub_context">
</context>
</context>


On Nov 4, 2016, at 9:27 AM, Willy Ray <[hidden email]> wrote:

I'm not finding the documentation for that.  My google-fu is weak, I guess.  Is it in the documentation somewhere?

On Fri, Nov 4, 2016 at 7:08 AM, Nick Collier <[hidden email]> wrote:
You don’t have to register it in the score file as that no longer exists, but you do need to add it to the context.xml as a nested context element in the context.xml

On Nov 3, 2016, at 11:41 AM, Willy Ray <[hidden email]> wrote:

I have a room with some zones.  

Room and Zone both extend DefaultContext

public Context build(Context<Object> context) {

     // TODO Auto-generated method stub


     room = new Room<Object>();

     context = room;

     Zone<Object> z0 = new Zone<Object>(0);

     room.addSubContext(z0);

...

}


This fails with "repast.simphony.engine.controller.DefaultController - Unable to initialize a subcontext: check that subcontext constructors are passed the correct name"

The only mailing list responses I can find refer to adding the subcontexts in the .score file, but I think that's deprecated, right?  How do I set up a subContext under Repast Simp. 2.3?


Thanks,


Willy





------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest






------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: Trouble adding a subContext. Do we still have to register it in a ".score" file?

Willy Ray-2
Thanks, Nick.

Specifically, I have a Room with two or more ContaminationZones.  

This seems to work:

room = new Room<Object>();

ContaminationZone<Object> z0 = new ContaminationZone<Object>(0);

z0.setId("zone0");

room.addSubContext(z0);

ContaminationZone<Object> z1 = new ContaminationZone<Object>(1);

z1.setId("zone1");

room.addSubContext(z1);

All the ContextUtils functions return stuff that is sensible.  The context.xml entry is using id=ContaminationZone.  So despite the fact that it seems to be working, and I can iterate over room.getSubContexts() guess I'm sad to say I'm still pretty unclear on what's actually going on with subcontexts.  setType() is new to me.  What is THAT supposed to do?

/w

  


On Thu, Nov 10, 2016 at 2:07 PM, Nick Collier <[hidden email]> wrote:
I haven’t done this in a while, but I think in cases where you may have multiple subcontexts of the same class, you can set a type on them with setType() (e.g. setType(“room”) and then use the type string in the context.xml.

Nick


On Nov 10, 2016, at 11:38 AM, Willy Ray <[hidden email]> wrote:

how does the id of the subcontext relate to the class of the subcontext?  If I have a Room context with a Zone context, how do the Zones get mapped to the subcontext listed in the context.xml file?  Do I have to do "setId()" on them?  

Thanks.

On Fri, Nov 4, 2016 at 9:50 AM, Nick Collier <[hidden email]> wrote:
In the context.xml, your master context will look somethine like:

<context id="jzombies"
xsi:noNamespaceSchemaLocation="http://repast.org/scenario/context">
<projection type="continuous space" id="space"></projection>
<projection type="grid" id="grid"></projection>
<projection type="network" id="infection network"></projection>

</context>

Adding a subcontext to that is just a matter for adding an additional <context> element in side that.

<context id="jzombies"
xsi:noNamespaceSchemaLocation="http://repast.org/scenario/context">
<projection type="continuous space" id="space"></projection>
<projection type="grid" id="grid"></projection>
<projection type="network" id="infection network"></projection>

<context id=“jz_sub_context">
</context>
</context>


On Nov 4, 2016, at 9:27 AM, Willy Ray <[hidden email]> wrote:

I'm not finding the documentation for that.  My google-fu is weak, I guess.  Is it in the documentation somewhere?

On Fri, Nov 4, 2016 at 7:08 AM, Nick Collier <[hidden email]> wrote:
You don’t have to register it in the score file as that no longer exists, but you do need to add it to the context.xml as a nested context element in the context.xml

On Nov 3, 2016, at 11:41 AM, Willy Ray <[hidden email]> wrote:

I have a room with some zones.  

Room and Zone both extend DefaultContext

public Context build(Context<Object> context) {

     // TODO Auto-generated method stub


     room = new Room<Object>();

     context = room;

     Zone<Object> z0 = new Zone<Object>(0);

     room.addSubContext(z0);

...

}


This fails with "repast.simphony.engine.controller.DefaultController - Unable to initialize a subcontext: check that subcontext constructors are passed the correct name"

The only mailing list responses I can find refer to adding the subcontexts in the .score file, but I think that's deprecated, right?  How do I set up a subContext under Repast Simp. 2.3?


Thanks,


Willy





------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest







------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest