473,402 Members | 2,072 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Simulating a queue model

HI EVERYONE:

i'm trying to simulate the following program which is the implementation of a m/m/2/k queue system, and i've got some errors.Could someone help me to solve this problem?

the program is :

#include <stdio.h> // Needed for printf()
#include "smpl.h" // Needed for SMPL
#define K 10
//===== Main program ================================================== ========
void main(void)
{
real Ta = 200; // Mean interarrival time (seconds)
real Ts = 100; // Mean service time
real te = 1.0e6; // Total simulation time
int customer = 1; // Customer id (always '1' for this simulation)
int event; // Event (1 = arrival, 2 = request, 3 = completion)
int server; // Handle for server facility

// Initialize SMPL subsystem
smpl(0, "M/D/2/K Queue");

// Initialize server facility (single server)
server=facility("server", 2);

// Schedule arrival event at time 0 to kick-off simulation
schedule(1, 0.0, customer);

// Loop while simulation time is less than te
while (time() < te)
{
// "Cause" the next event on the event list
cause(&event,&customer);

// Process the event
switch(event)
{
case 1: // *** Arrival
if ((inq(server) + status(server)) < K)
schedule(2, 0.0, customer);
schedule(1, Ta, customer);
break;

case 2: // *** Request Server
if (request(server, customer, 0) == 0)
schedule(3, expntl(Ts), customer);
break;

case 3: // *** Release server
release(server, customer);
break;
}
}

// Output standard SMPL report
report();
}


The errors are:
md2k.obj : error LNK2001: unresolved external symbol "void __cdecl report(void)" (?report@@YAXXZ)
md2k.obj : error LNK2001: unresolved external symbol "void __cdecl release(int,int)" (?release@@YAXHH@Z)
md2k.obj : error LNK2001: unresolved external symbol "double __cdecl expntl(double)" (?expntl@@YANN@Z)
md2k.obj : error LNK2001: unresolved external symbol "int __cdecl request(int,int,int)" (?request@@YAHHHH@Z)
md2k.obj : error LNK2001: unresolved external symbol "int __cdecl status(int)" (?status@@YAHH@Z)
md2k.obj : error LNK2001: unresolved external symbol "int __cdecl inq(int)" (?inq@@YAHH@Z)
md2k.obj : error LNK2001: unresolved external symbol "void __cdecl cause(int *,int *)" (?cause@@YAXPAH0@Z)
md2k.obj : error LNK2001: unresolved external symbol "double __cdecl time(void)" (?time@@YANXZ)
md2k.obj : error LNK2001: unresolved external symbol "void __cdecl schedule(int,double,int)" (?schedule@@YAXHNH@Z)
md2k.obj : error LNK2001: unresolved external symbol "int __cdecl facility(char *,int)" (?facility@@YAHPADH@Z)
md2k.obj : error LNK2001: unresolved external symbol "void __cdecl smpl(int,char *)" (?smpl@@YAXHPAD@Z)
Debug/md2k.exe : fatal error LNK1120: 11 unresolved externals
Error executing link.exe.

md2k.exe - 12 error(s), 0 warning(s)
Jan 17 '07 #1
2 5493
Motoma
3,237 Expert 2GB
The errors are:
md2k.obj : error LNK2001: unresolved external symbol "void __cdecl report(void)" (?report@@YAXXZ)
md2k.obj : error LNK2001: unresolved external symbol "void __cdecl release(int,int)" (?release@@YAXHH@Z)
md2k.obj : error LNK2001: unresolved external symbol "double __cdecl expntl(double)" (?expntl@@YANN@Z)
md2k.obj : error LNK2001: unresolved external symbol "int __cdecl request(int,int,int)" (?request@@YAHHHH@Z)
md2k.obj : error LNK2001: unresolved external symbol "int __cdecl status(int)" (?status@@YAHH@Z)
md2k.obj : error LNK2001: unresolved external symbol "int __cdecl inq(int)" (?inq@@YAHH@Z)
md2k.obj : error LNK2001: unresolved external symbol "void __cdecl cause(int *,int *)" (?cause@@YAXPAH0@Z)
md2k.obj : error LNK2001: unresolved external symbol "double __cdecl time(void)" (?time@@YANXZ)
md2k.obj : error LNK2001: unresolved external symbol "void __cdecl schedule(int,double,int)" (?schedule@@YAXHNH@Z)
md2k.obj : error LNK2001: unresolved external symbol "int __cdecl facility(char *,int)" (?facility@@YAHPADH@Z)
md2k.obj : error LNK2001: unresolved external symbol "void __cdecl smpl(int,char *)" (?smpl@@YAXHPAD@Z)
Debug/md2k.exe : fatal error LNK1120: 11 unresolved externals
Error executing link.exe.
It looks like the linker is having trouble finding the function calls you are making. Is there a .c or .cpp file that needs to be added to your project? Is there an external DLL which you need to link against?
Jan 17 '07 #2
horace1
1,510 Expert 1GB
you are including the SMPL header file smpl.h and calling the functions so you also need to compile and link the smpl library which is probably in a file smpl.c
If you don't have it you can download it from the link in the Simulation Tools section of
http://www.csee.usf.edu/~christen/tools/toolpage.html
Jan 17 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: phil | last post by:
And sorry I got ticked, frustrating week >And I could help more, being fairly experienced with >threading issues and race conditions and such, but >as I tried to indicate in the first place,...
29
by: Paul L. Du Bois | last post by:
Has anyone written a Queue.Queue replacement that avoids busy-waiting? It doesn't matter if it uses os-specific APIs (eg WaitForMultipleObjects). I did some googling around and haven't found...
16
by: newsock | last post by:
What differences between queue, deque and priority_queue? And under what situations choose one of them to use? Thanks for your help!
2
by: A Waterfall That Barks | last post by:
http://www.c-sharpcorner.com//Code/2003/March/SwarmSim.asp I just found this port of the swarm groups famous 'complexity from simple interacting agents' type software. Very easy to load and...
1
by: Chris | last post by:
Hi. I have a ibrary I'm trying to use via javascript within IE. This library uses an asynchronous model where I call into a function and pass it a callback function as one of its arguments. My...
2
by: Zhaozhi Gao | last post by:
I'm doing a simple project for school. This is the first time I've ever used Access. Is there a way i can simulate a Circular Queue data structure for the datas in a table. I tried assign index...
16
by: William Stacey [MVP] | last post by:
Anyone care to comment on if this non-blocking queue implementation is sound? /// <summary> /// Summary description for NonBlockingQueue. /// Modeled after:...
15
by: Bjoern Schliessmann | last post by:
Hello all, I'm trying to simulate simple electric logic (asynchronous) circuits. By "simple" I mean that I only want to know if I have "current" or "no current" (it's quite digital) and the only...
5
by: Xu, Qian | last post by:
Hello All, I have some problem by simulating a link click using javascript. The webpage uses a js-library named interface (jQuery like) ------------------------------ <a id="foo" href="#">Try...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.