Mesquite Software Home
Products / FAQ
Customers
To Order
Contact Us
Site Map
Documentation
News / Events
News & Events

Mesquite Software Newsletter

Volume 2 - Summer 2005

Welcome to the Mesquite Software Summer 2005 newsletter! It's hard to believe that our spring has so rapidly capitulating to summer's oppressive heat here in Austin, but it's been a good year for Mesquite so far, and we wish the same for you. In addition to launching our new end-to-end CSIM 19 electronic purchase and download in March, Mesquite's founder and president are pleased to announce a new CSIM training course!


CSIM Training Course Now Available

Want to learn CSIM the easy way? Mesquite Software now offers CSIM training courses! Taught by University of Texas professor and long-time CSIM contributor Dr. Jeff Brumfield, this hands-on course teaches CSIM basics plus inside tips and tricks for optimizing CSIM use. You'll also learn best practices to follow when programming discrete event simulations.

John McLemore, a Senior Staff Software Engineer in Phoenix, AZ, offers high praise, "I cannot remember a time where I have learned so much in a two-day period in such enjoyable and comfortable surroundings - and my team described the same experience. I would highly recommend this training for any team serious about performance modeling."

Our next CSIM training class is scheduled for September 13-15, 2005, in Austin, TX. For more information, please visit www.mesquite.com/training


Don't Wait to Use CSIM 19 - Electronic Purchase and Download Now Live

Now you can order CSIM online and begin using it immediately! Check out our new online purchase process at www.mesquite.com. You can still request software on CD-ROM, but now you don't have to wait to begin using CSIM.


Coming soon - CSIM for Java!

CSIM for Java is currently under development! Soon you will be able to run your favorite CSIM simulations in Java as well as C and C++.

If you are interested in beta-testing a pre-release copy of CSIM for Java, please let us know.


We Want Your CSIM User Stories

We've recently started to publish stories describing some of our best users' applications. If you fill out our User Story form online at www.mesquite.com/customers/userform.htm with details of your CSIM application, we'll send you a limited edition CSIM anniversary t-shirt! And if your story is selected for publication on our User Stories page at www.mesquite.com/customers/userstories.htm, you'll also receive a complimentary year of extended support!


Going to a Conference?

If you're going to a conference and presenting a project that uses CSIM, we'd love to hear about it! Send your conference proceedings referencing CSIM to us, and we'll send you a CSIM anniversary t-shirt. We may also request permission to write a user story about your project!

I find mailboxes to be among the more useful CSIM objects. The usefulness expanded for me when I realized that I could use an object pointer as a message. This note demonstrates how to use mailboxes with objects.

The example below is a two-class M/M/1 queue implemented as a client-server system. A generator process sends messages to a mailbox; the server process receives these messages; then based on the type of the message, it "uses" the CPU facility for an exponentially distributed service time, with the mean depending on the type of the message.

First, the message class looks like this:

class msg_c {
protected:
	int type;
	double startTime;
public:
	msg_c(int t)
		{type = t; startTime = clock;}
	int getType()		{return type;}
	void setType(int t)		{type = t;}
	double getStartTime()		{return startTime;}
};

Then the server process is as follows:

void server()
{
	msg_c *msg;
	double st;

	create("server");
	while(true) {
		mbox->receive((long*)&msg);
		switch(msg->getType()) {
		case TYPE0:
			st = 1.0; break;
		case TYPE1:
			st = 2.0; break;
		default:
			break;
		}
		cpu->use(exponential(st));
		respTime->record(clock - msg->getStartTime());
		delete msg;
	}
}

Finally, the generator process, which sends the messages to the server, looks like this:

void gen()
{
	msg_c *msg;
	int type;

	create("gen");
	while(true) {
		type = uniform_int(0, numTypes-1);
		msg = new msg_c(type);
		mbox->send((long)msg);
		hold(exponential(3.0));
	}
}

Notice that in the gen() process, the send() method uses a type-cast for the msg pointer; similarly, in the server() process, the receive() method uses a type-case for the same reason.

This example, in addition to demonstrating how to send an object pointer as a message for a mailbox, also highlights another point: it is usually possible to implement a model using a paradigm based on representing the active entities as processes. It is also possible to implement the same model using a paradigm based on representing entities as messages being generated and processed by processes. These methods raise a question: which paradigm is better?

In my experience, the process-based paradigm is more straightforward and easier to implement and validate. I have also found that the message-based paradigm may be a more faithful representation of the "real" system. For this reason, the paradigm based on having clients sending messages to servers is often the favored approach.

Additional note: In some systems, the client may need to operate in a synchronous fashion (i.e., the clients send a message to the server and then wait for the response). The message class can be easily extended to allow this, as follows:

class msg_c {
	protected:
		...
		mailbox *replyBox;
	public:
		msg_c(int t, mailbox *rb)	{...; replyBox = rb;}
		mailbox *getReplyBox()		{return replyBox;}
};

The server process has some added statements:

void server()
{
	msg_c *msg;
		...
		cpu->use(exponential(st));
		msg->getReplyBox()->send((long)msg);
	}

Now, instead of generating the message in the gen() process, we have a client process that instantiates the mailbox to be used for the reply message, sends the request, and then receives the response message:

void client()
{
	mailbox *reply;
	msg_c *msg;
	int type;

	create("client");
	reply = new mailbox("reply");
	type = uniform_int(0, numTypes-1);
	msg = new msg_c(type, reply);
	mbox->send((long)msg);
	reply->receive((long*)&msg);
	respTime->record(clock - msg->getStartTime());
	delete reply;
	delete msg;
}

So, remember: for a CSIM modeler, mailboxes are powerful tools!

Herb Schwetman


Feedback Please!

We are currently designing CSIM for Java and CSIM 20 and would like to be able to incorporate your suggestions.

If you have comments or suggestions on CSIM 19, do let us know!

Come visit us at www.mesquite.com to see our latest updates, or contact us directly if you have ideas, comments, or questions.


Please explore our website to see our latest updates, or contact us directly if you have ideas, comments, or questions.

With kind regards,

Nan Schwetman, President
Mesquite Software, Inc.
8500 North MOPAC, Suite 825
Austin, TX 78759, USA
Tel: (800) 538-9153 (US) or +1 (512) 338-9153
Fax: +1 (512) 338-4966
E-mail:
www: www.mesquite.com

This newsletter is sent to our user community and interested parties by Mesquite Software. You may subscribe by visiting: www.mesquite.com/newsletter/signup.html