C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 5th, 2003, 03:11 PM
hotel_project hotel_project is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 17 hotel_project User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Simulation ALOHA in C++

Well I need to simualte the Slotted and Pure ALOHA protocol using C++

so I need to know the parameters and metrics

so any one has knowledge or knows any site for that??

Thank u very much

Reply With Quote
  #2  
Old July 6th, 2003, 12:36 AM
DudeThatWasRude DudeThatWasRude is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 7 DudeThatWasRude User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Slotted ALOHA Simulation Parameters

//

// global simulation parameters
//

sim
logfile truncate
checkpoint-variant slots // frame, slots or
milleseconds

end
//
// model 1 definition
//
model 1
slot 1 // packet slot size
in Mb
packet-slots 1
channel 1000 // channel speed in Mb/sec
protocol SALOHA
time 1000000
checkpoint-interval 1
log yes
trace no
end
model 2
slot 1 // packet slot size
in Mb
packet-slots 1
channel 1050 // channel speed in Mb/sec
protocol SALOHA
time 1000000
checkpoint-interval 1
log yes
trace no
end

model 3
slot 1 // packet slot size in Mb
packet-slots 1
channel 1100 // channel speed in Mb/sec
protocol SALOHA
time 1000000
checkpoint-interval 1
log yes
trace no
end

model 4
slot 1 // packet slot size in Mb
packet-slots 1
channel 1150 // channel speed in Mb/sec
protocol SALOHA
time 1000000
checkpoint-interval 1
log yes
trace no
end

model 5
slot 1 // packet slot size in Mb
packet-slots 1
channel 1200 // channel speed in Mb/sec
protocol SALOHA
time 1000000
checkpoint-interval 1
log yes
trace no
end

model 6
slot 1 // packet slot size in Mb
packet-slots 1
channel 1250 // channel speed in Mb/sec
protocol SALOHA
time 1000000
checkpoint-interval 1
log yes
trace no
end

model 7
slot 1 // packet slot size in Mb
packet-slots 1
channel 1300 // channel speed in Mb/sec
protocol SALOHA
time 1000000
checkpoint-interval 1
log yes
trace no
end

model 8
slot 1 // packet slot size in Mb
packet-slots 1
channel 1350 // channel speed in Mb/sec
protocol SALOHA
time 1000000
checkpoint-interval 1
log yes
trace no
end

model 9
slot 1 // packet slot size in Mb
packet-slots 1
channel 1400 // channel speed in Mb/sec
protocol SALOHA
time 1000000
checkpoint-interval 1
log yes
trace no
end

model 10
slot 1 // packet slot size in Mb
packet-slots 1
channel 1450 // channel speed in Mb/sec
protocol SALOHA
time 1000000
checkpoint-interval 1
log yes
trace no
end

model 11
slot 1 // packet slot size in Mb
packet-slots 1
channel 1500 // channel speed in Mb/sec
protocol SALOHA
time 1000000
checkpoint-interval 1
log yes
trace no
end

model 12
slot 1 // packet slot size in Mb
packet-slots 1
channel 1550 // channel speed in Mb/sec
protocol SALOHA
time 1000000
checkpoint-interval 1
log yes
trace no
end

model 13
slot 1 // packet slot size in Mb
packet-slots 1
channel 1600 // channel speed in Mb/sec
protocol SALOHA
time 1000000
checkpoint-interval 1
log yes
trace no
end

model 14
slot 1 // packet slot size in Mb
packet-slots 1
channel 1650 // channel speed in Mb/sec
protocol SALOHA
time 1000000
checkpoint-interval 1
log yes
trace no
end

model 15
slot 1 // packet slot size in Mb
packet-slots 1
channel 1700 // channel speed in Mb/sec
protocol SALOHA
time 1000000
checkpoint-interval 1
log yes
trace no
end

model 16
slot 1 // packet slot size in Mb
packet-slots 1
channel 1750 // channel speed in Mb/sec
protocol SALOHA
time 1000000
checkpoint-interval 1
log yes
trace no
end

model 17
slot 1 // packet slot size in Mb
packet-slots 1
channel 1800 // channel speed in Mb/sec
protocol SALOHA
time 1000000
checkpoint-interval 1
log yes
trace no
end

model 18
slot 1 // packet slot size in Mb
packet-slots 1
channel 1850 // channel speed in Mb/sec
protocol SALOHA
time 1000000
checkpoint-interval 1
log yes
trace no
end

model 19
slot 1 // packet slot size in Mb
packet-slots 1
channel 1900 // channel speed in Mb/sec
protocol SALOHA
time 1000000
checkpoint-interval 1
log yes
trace no
end

model 20
slot 1 // packet slot size in Mb
packet-slots 1
channel 1950 // channel speed in Mb/sec
protocol SALOHA
time 1000000
checkpoint-interval 1
log yes
trace no
end

ALOHA PROTOCOL IN C

#include <stdio.h>
#include <math.h>
#include <time.h>
#include <dos.h>

#define FRAME_TIME 250

main()
{
float S1, S2, G, J, val[100] ;
int I, n, K, delay ;
void wait() ;
clrscr() ;
printf("Please Give the Total Load : ");
scanf("%d", &n);
printf("Please Enter the value of load \n");
for (I=0; I<n; I++)
{
scanf("%f", &val[I]);
}
clrscr();
printf("\nOUTPUT 1: (THROUGHPUT Vs LOADCURVE)\n\n");
printf("s=g*exp(-G) FOR SLOTTED ALOHA * \n");
printf("s=g*exp(-2G) FOR PURE ALPHA #\n");
printf("\n------ (THROUGHPUT PER FRAME TIME)----\n");
for(K=0; K<n; K++)
{
G=val[K];
S1 = G * exp (-G);
S2 = G * exp(-2 * G);
printf("%1.3f", G );
for (I=0; I <=S1*20; I++)
{
printf(" ");
}
printf("*");
for(I=S2*20; I<=S2*75; I++ )
{
printf(" ");
}
printf("#\n");
}
printf("G (ATTEMPTS PER PACKET TIME) \n\n");
wait() ;
getch() ;
clrscr() ;
printf("\nOUTPUT 2 (DELAY Vs THROUGHPUT) \n\n");
printf("\n-----(THOUGHPUT PER FRAME TIME)----\n");
for(K=0; K<n; K++)
{
G=val[K];
S1 = G * exp (-G);
printf("3");
for (I=0; I <=S1*2.7; I++)
{
printf(" ");
}
printf("*\n");
}
printf("\n");
printf("---- DELAY -----");
wait();
getch();
clrscr();
}

void wait()
{
sound(440);
delay(300);
nosound();
}

OUTPUT of (THROUGHPUT V/S LOADCURVE)

s=g*exp(-G) FOR SLOTTED ALOHA *

s-g*exp(-2G) FOR PURE ALPHA #



-----------(THROUGHPUT PER FRAME TIME) ----->

0.0000003 * #

0.5000003 * #

1.0000003 * #

1.5000003 * #

2.0000003 * #

2.5000003 * #

3.0000003 * #

3.5000003 * #



G (ATTEMPTS PER PACKET TIME)







OUTPUT of (DELAY V/S THROUGHPUT)





------(THROUGHPUT PER FRAME TIME) ---->

3 *

3*

3*

3*

3*

3*

3*

3*

3*



--- DELAY------

Last edited by DudeThatWasRude : July 6th, 2003 at 12:38 AM.

Reply With Quote
  #3  
Old October 15th, 2005, 01:01 AM
gulrej gulrej is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 1 gulrej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 22 sec
Reputation Power: 0
project

hi
did u get the idea regarding ur project






Quote:
Originally Posted by hotel_project
Well I need to simualte the Slotted and Pure ALOHA protocol using C++

so I need to know the parameters and metrics

so any one has knowledge or knows any site for that??

Thank u very much

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Simulation ALOHA in C++


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway