Thread Subject:
Read from *.txt inside SimEvetns Embedded Matlab line by line

Subject: Read from *.txt inside SimEvetns Embedded Matlab line by line

From: Tiger

Date: 22 Jun, 2012 14:41:07

Message: 1 of 1

Hi all,

I have a text file named WF.txt and it has the following data:
Job Task Cores ET Depend
1 1 5 10
1 2 15 25 1
1 3 10 15 2
1 4 20 10 2,3

These are specifications for workflow jobs stored in WF.txt, I have simulated a queueing model in SimEvents. I have an entity generator with the attributes matching the text file's headers i.e. Job, Task, etc..

I've designed my model to have the entitiy generator placed before a matlab embedded function, and what I want to be able to do is extracting one row from the text file for each generated entity at a time and then assign the right value for the right attribute.

For instance I want my first entity to be like this:
Job = 1; Task = 1; Cores = 5; ET = 10; Depend = '', and for the second entity to have it as follows: Job = 1; Task = 2; Cores = 15; ET = 25; Depend =1.

I'm not sure whether it's best to use Embedded Matlab Editor or Function, as for the latter it requires me to do something with eml.extrinsic. The other minor issue here is for 'Depend' as it can have multiple values like in the last row, how can I then assign those to an entity attribute inside SimEvents, adn what format do you suggest for it?

Many thanks you guys and looking forward your comments :-).
________________
Tiger

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
text file Tiger 22 Jun, 2012 10:44:10
simevents Tiger 22 Jun, 2012 10:44:10
embedded matlab Tiger 22 Jun, 2012 10:44:10
rssFeed for this Thread

Contact us