XML Assigning Resources to Activities

XML Assigning Resources to Activities

Postby passingthrough » Mon Apr 24, 2017 6:24 pm

Hi,

I'm working on a small business project simulating some machinery moving underground, and am using the roadway junctions created as resources in order to prevent collisions between the two main pieces of machinery.

So for a given path (activity) around the mine, it uses specific nodes (resources), and I'm trying to automate the XML code part of this but whenever I create a <ResourceList> with the appropriate resource items inside linked to each path and then load this .xml simulation into SIMUL8, it only recognizes the resources for the first two activities I have, and even then it misses some resources from the list.

I reference the resources by their index number, the coding on my side is correct for what I WANT to output, I just don't think SIMUL8 is interpreting it correctly or I'm missing something. Here is an example of an activity I create:

Code: Select all

<SimulationObject Name="m3travelto" Type="Work Center" ID="27">
<Index>27</Index>
<DisplayData>
<X1>500</X1>
<Y1>600</Y1>
</DisplayData>
<InputList>
<Link>
<S8TheType>1000</S8TheType>
<ObjectID>23</ObjectID>
<Requnits>1</Requnits>
</Link>
</InputList>
<OutputList>
<Link>
<S8TheType>1000</S8TheType>
<ObjectID>28</ObjectID>
<Requnits>1</Requnits>
</Link>
</OutputList>
<Resourcesfirst>No</Resourcesfirst>
<ResourceList>
<ResourceItem Position="6">
<Resource>6</Resource>
<MinNumber>1</MinNumber>
<MaxNumber>1</MaxNumber>
<PurposeCode>3</PurposeCode>
<HoldOrReleaseCode>0</HoldOrReleaseCode>
</ResourceItem>
<ResourceItem Position="9">
<Resource>9</Resource>
<MinNumber>1</MinNumber>
<MaxNumber>1</MaxNumber>
<PurposeCode>3</PurposeCode>
<HoldOrReleaseCode>0</HoldOrReleaseCode>
</ResourceItem>
<ResourceItem Position="8">
<Resource>8</Resource>
<MinNumber>1</MinNumber>
<MaxNumber>1</MaxNumber>
<PurposeCode>3</PurposeCode>
<HoldOrReleaseCode>0</HoldOrReleaseCode>
</ResourceItem>
</ResourceList>
<ChangeOverResourceList>
<ResourceItem Position="6">
<Resource>6</Resource>
<MinNumber>1</MinNumber>
<MaxNumber>1</MaxNumber>
<PurposeCode>3</PurposeCode>
<HoldOrReleaseCode>0</HoldOrReleaseCode>
</ResourceItem>
<ResourceItem Position="9">
<Resource>9</Resource>
<MinNumber>1</MinNumber>
<MaxNumber>1</MaxNumber>
<PurposeCode>3</PurposeCode>
<HoldOrReleaseCode>0</HoldOrReleaseCode>
</ResourceItem>
<ResourceItem Position="8">
<Resource>8</Resource>
<MinNumber>1</MinNumber>
<MaxNumber>1</MaxNumber>
<PurposeCode>3</PurposeCode>
<HoldOrReleaseCode>0</HoldOrReleaseCode>
</ResourceItem>
</ChangeOverResourceList>
<OperationTimeSampleData>
<Userates>No</Userates>
<DistParam1>1.33333333333333</DistParam1>
<DistribType>2</DistribType>
</OperationTimeSampleData>
</SimulationObject>
Also I included this <ChangeOverResourceList> because Simul8 kept re-saving the .xml file with this included, but I don't understand why it's necessary if I'm releasing my resources as their original type.

Can anyone help? The XML Schema.xsd doesn't contain any such <ChangeOverResourceList> tag.

Thanks in advance.

Re: XML Assigning Resources to Activities

Postby passingthrough » Tue Apr 25, 2017 1:57 pm

Problem Solved.

When assigning resources to activities, I was in fact using the Resource index number as the Position in the list of resources used for that activity, so where I had Resources with indexes 2, 3 and 8, the <Resource> tag under <ResourceItem> needs to remain the resource index, so <Resource>2</Resource>, <Resource>3</Resource> etc but the 'position' part of the <ResourceItem...> tag needs to remain like a list of positive integers, i.e. the corrected code from my original post would be:

Code: Select all

<SimulationObject Name="m3travelto" Type="Work Center" ID="27">
<Index>27</Index>
<DisplayData>
<X1>500</X1>
<Y1>600</Y1>
</DisplayData>
<InputList>
<Link>
<S8TheType>1000</S8TheType>
<ObjectID>23</ObjectID>
<Requnits>1</Requnits>
</Link>
</InputList>
<OutputList>
<Link>
<S8TheType>1000</S8TheType>
<ObjectID>28</ObjectID>
<Requnits>1</Requnits>
</Link>
</OutputList>
<Resourcesfirst>No</Resourcesfirst>
<ResourceList>
<ResourceItem Position="1">
<Resource>6</Resource>
<MinNumber>1</MinNumber>
<MaxNumber>1</MaxNumber>
<PurposeCode>3</PurposeCode>
<HoldOrReleaseCode>0</HoldOrReleaseCode>
</ResourceItem>
<ResourceItem Position="2">
<Resource>9</Resource>
<MinNumber>1</MinNumber>
<MaxNumber>1</MaxNumber>
<PurposeCode>3</PurposeCode>
<HoldOrReleaseCode>0</HoldOrReleaseCode>
</ResourceItem>
<ResourceItem Position="3">
<Resource>8</Resource>
<MinNumber>1</MinNumber>
<MaxNumber>1</MaxNumber>
<PurposeCode>3</PurposeCode>
<HoldOrReleaseCode>0</HoldOrReleaseCode>
</ResourceItem>
</ResourceList>
<OperationTimeSampleData>
<Userates>No</Userates>
<DistParam1>1.33333333333333</DistParam1>
<DistribType>2</DistribType>
</OperationTimeSampleData>
</SimulationObject>
I also omitted the <ChangeOverResourceList> because I didn't find it necessary to my code.


Return to “SIMUL8 Cafe”