Sunday, 28 December 2014

Application of Auction Based Algorithm to Wireless Sensor Networks

Algorithm:

The algorithm initializes the price of each good to be unit, computes the worth of the initial endowment of each agent, and gives this money to each agent. All goods are initially fully unsold.
We will denote by p=(p1,p2,...,pn) the vector of prices of goods at any point in the algorithm. As p changes, the algorithm recomputes the value of each agent’s initial endowment and updates her money accordingly. Clearly, at the start of the algorithm, the total surplus (unspent) money of all agents is n.
At any point in the algorithm, a part of good j is sold at price pj and part of it is sold at (1+€)pj. The run of the algorithm is partitioned into iterations. Each iteration terminates when the price of some good is raised by a factor of (1+€). Each iteration is further partitioned into rounds. In a round, the algorithm considers agents one by one in some arbitrary but fixed order, say 1,2,...,m. If the agent being considered, i, has no surplus money, the algorithm moves to the next agent. Otherwise, it finds i’s optimal good, in terms of bang per buck, at current prices; say, it is good j. It then proceeds to execute the operation of outbid. This entails buying back good j from agents who have it at price pj and selling it to i at price pj(1+€). This process can end in one of two ways:
Agent i’s surplus money is exhausted. If so, the algorithm moves on to the next agent.
No agent has good j at price pj anymore. If so, it raises the price of good j to pj(1+€) by setting pj to pj(1+€). The current iteration terminates and agents’ moneys are updated because of this price rise.
When the current round comes to an end, the algorithm checks if the total surplus money with the buyers is at most €a min. If so, the algorithm terminates. Otherwise, it goes to the next round.
At termination, the algorithm gives the unsold goods to an arbitrary agent to ensure that the market clears. It outputs the allocations received by all agents and the terminating prices p. Observe, however, that some of good j may have been sold at price (1+€) pj even though the equilibrium price of good j is pj. Because of this descrepancy, agents will only get approximately optimal bundles.

Process Model:

The process model has three states:
Initialization state [init]
Idle state [wait]
Checking request state [chec_rqst_typ]


 

Initialization state [init]:

This is a forced state. This state initializes the process. Executes the enter executives as under


total_bw = 1024; //total bandwidth that can be allocated
bw_req_value =0; //initialize req value to zero
self_ID = op_id_self ();  
op_ima_obj_attr_get (self_ID,"bw_variable", &bw_variable);   //obtain attributes of the packets.


Idle state [wait]:

This is an unforced state. When the command comes to this state, it waits for an interrupt [PKT_ARRIVAL]. When the interrupt [PKT_ARRIVAL] comes it sends the command to the next state [ pkt_rqst_typ ], otherwise it waits.

Checking request state [chec_rqst_typ]:

This is a forced state. Command is send to this state if the interrupt [PKT_ARRIVAL] comes. It executes the following enter executives,

pkt_pointer = op_pk_get(0);
op_pk_nfd_get (pkt_pointer, "bw_req", &bw_req_value);
request_array[i] = bw_req_value;
++i;
if (i==49)
{
op_sim_end("","","","") ;
}
This assigns the packet pointer and obtain desired packet attributes, assigns the attributes to the request array and if the requests exceeds the total bandwidth then end the simulation.
Then it executes the following exit executives,

total_bw=total_bw-bw_req_value;   //allocate  bandwidth
send_pkt  = op_pk_create_fmt("out_pkt");
op_pk_nfd_set (send_pkt, "pk_nmbr",i );
op_pk_send (send_pkt, OUT_STRM);
This assigns bandwidth as requested and send the packet through OUT_STRM, and send the command back to the idle state.


Node Model:

The node model has the following components
Packet generator
Processor [Auction Algorithm]
Transmitter
Receiver
 

Packet generator:

Packet generator generate packets of the type ” bw_req_packet”.
The process model of the packet generator is as under
 
The following enter executives are executed as the process runs

new_pkt  = op_pk_create_fmt("bw_req_packet");
op_pk_nfd_set (new_pkt, "bw_req",4 );
op_pk_send (new_pkt,0);

It creates a packet formate "bw_req_packet" and sets the "bw_req" field to the desired value as this will request for the bandwidth when the packet is received by the receiver.

Packet format:

The packet format is named as bw_req_packet and is as under
                                           
The packet format has the following 4 fields
Source address
Destination address
Cyclic redundancy check
Bandwidth request value

Processor [Auction Algorithm]:

This is the main algorithm processor. The process model is as under
 

The initializing state:

This is a forced state and it execute the following enter executives

total_bw = 1024; //total bandwidth that can be allocated
bw_req_value =0; //initialize req value to zero
self_ID = op_id_self ();
op_ima_obj_attr_get (self_ID,"bw_variable", &bw_variable);
It initializes the total bandwidth variable, and sets the bandwidth request value to 0. Then it sends command to the idle state.

Idle state:

This is an unforced state and it waits for an interrupt of the type PKT_ARRIVAL then it sends the command to the next state.

Checking request state [chk_rqst_typ]:

This is a forced state. This process model is stated in the start. This assigns the packet pointer and obtain desired packet attributes, assigns the attributes to the request array and if the requests exceeds the total bandwidth then end the simulation.
Then it assigns bandwidth as requested and send the packet through OUT_STRM, and send the command back to the idle state.

Transmitter:

It sends the packet which is requested to send through OUT_STRM.

Receiver:

It receives packets form the IN_STRM and forward it to the next process.


Node interfaces:

The node model has the following node interfaces
 

The following are the node statistics
 

Project:
The project has two nodes as under
 
The first run of the project was empty scenarios.
 

Object attributes are as under
 

GSM BASED MONITORING AND CONTROLLING OF WIRING SYSTEM

GSM BASED MONITORING AND CONTROLLING OF WIRING SYSTEM

Abstract:
The aimed objective of this project is to design a microcontroller based protection of wiring system. The protection includes temperature of the conductors and the limitations of current. In this project all the information about the current and temperature will be sent to the main unit by using user cell phone. The user has the capability to control the system, but if the user didn’t response to the alerts then system selects the automatic mode, and takes the safety precautions. This will turn of the main switch for the sake of better protection.


Aim of The Project
The main core of this project is to design such a system which protects the wiring system automatically. The second objective of the project is to control and monitor the limitation of current and temperature, where user will a be informed by using GSM module.


Introduction: 
Electrical wiring in general refers to insulated conductors used to carry electricity, and associated devices. This article describes general aspects of electrical wiring as used to provide power in buildings and structures, commonly referred to as building wiring. This article is intended to describe common features of electrical wiring that may apply worldwide. For information regarding specific national electrical codes, refer to the articles mentioned in the next section. Separate articles cover long-distance electric power transmission and electric power distribution.
With the evolution and proliferation of electrical systems usage throughout all of today’s cutting edge business sectors and industries, the need to protect these applications has never been more important, and it’s a tidal wave of progress that shows no sign of abating. More and more, functions and processes throughout a diverse range of industries are reliant on sophisticated and sensitive electronics and electrical communications, whether it be on (or under) land, on (and below) the sea, up in the air, or even high above the earth.

One such area this applies to, is the Marine sector. Like all modes of transportation, nautical vessel technology has not just evolved but been revolutionized through the advent and subsequent advances in electronics and electrical engineering. Our ancestors – even from as recently as the nineteenth century – would be dumbstruck by the revolution that has taken place.



Problem Statement:
Controlling the temperature and current limit.
Sending all the information to the user on cell phone for the sake of controlling purpose.
Displaying all the information on LCD.


Methodology:
The best solution to tackle these problems is by using GSM Based Monitoring And Controlling Of Wiring System Because this scheme have the ability to control and monitor the wiring system remotely. 
For measuring the current we will use C.T (current transformer), which is interfaced with ADC, the ADC convert the analog signal to digital and transfer it to the microcontroller, microcontroller also measure the temperature through thermistor, here the controller sends all the data to user cell phone and main unit by using GSM module for the sake of monitoring. Here controller display the results on LCD and after some time it starts to give buzzer. Where on the user cell phone this information will be send through SMS (short message service). User can control the load remotely by replying on the same number. The GSM receive the signal and transfer it to the controller, which turn off the load through relay, the relay will be connected with relay drive unit which control the relay.


So the methodology we are using is quite simple and reliable and it needs the following components.
Voltage regulator
LED
Diodes
Transformer
Bridge
temperature sensor
GSM module
Microcontroller
Op-amp
Buzzer
Relay driver
Relay
ADC
LCD 





Block Diagram Representation:

APPLICATION
“Through proper implementation of this project, governments can improve program and infrastructure quality, increase information accessibility and use, with improved decision making application makes more interesting and decreases overall cost of the application, so this project can be used to improve the wiring system in military organizations, local police organizations, home/offices, security organization etc.
REFERENCES:
[1] 8051 microcontroller BY Muhammad Ali Mazidi ISBN: 978-81-317-5899-1
[2] Electronic devices and circuit theory BY Thomas C. Schelling 
[3]Electrical and electronic technology books.







Eat Onion

although onion bring tears in your eyes but it does not mean that you avoid eating onion , it has many advantages for a healthy body, 90 percent of the food we eat daily we use onion,

  1. Onion contain sulphate that help to reduce the viscosity of blood and reduce cholesterol level in the blood thus reduced blood pressure 
  2. It help to improve the working of vitamins c in our body thus it help to improve in immune system
  3. it also help to regulate sugar level in the blood , because of chromium it contain.
  4. it is some time use for healing purposes and for curing skin when some one is bit by bees.
  5. it also fight again cancer cell , thus it good to use for the people having cancer.
  6. i like eating onion, do you like to eat onion as a slice?

Friday, 26 December 2014

Do you know!

After death of human five  thing alive for certain period of time.
  • HEART 
  • BRAIN
  • BONES
  • SKIN
  • EYES  
  • heart live for 10 minutes, brain for 20 minutes, bones for 30 days, skin for 5 days and eyes remain alive for 4 hours.

Wednesday, 17 December 2014

They went to school and never come back

By ugmai afridi written by ugmai.afridi



PESHAWAR IS BLEEDING:
Are we humans or animals??..I am confused because a human would never do such a WILD & VOILENT act...the kids that got targeted were the ones who never wanted to come out of the blanket at morning, every morning they had a fight with their mothers over socks ...where is the humanity gone?.. 16/12/14 Tuesday, will be recalled as the history of warsak road's APS bleeding innocence
Kids were in the auditorium of famous army school (army public school warsak road peshawar) having their first aid class..... and suddenly the door of the hall exploded and some terrorist entered the hall.. they burnt the teachers with no mercy... kids were killed one by one.. some were targeted right on their heads,some of them lost their eyes,legs and fingers..... many explosives were planted in every department...13 bombs blasted, 4 got defused ... but the question is how did they let them enter? How did they get these explosives into the school? What did they want? What was their demand? What was the plan behind this brutal massacre? Did they get anything? These are the questions that are making us lose our minds...
Because of 9, we lost 150+ stars, shinning stars...this tragedy made us drop our jaws,lose our mind, made us cry our heart out and tore us apart... word HUMANITY itself says HUMAN-UNITY.... but sadly we are not humans, the terrorists are not aliens or say a specie of any other planet..they belong to us.. they look like us.. they are like us.. we are monsters that kills angels..

Mothers carry their child for 9 months,make them learn to walk, make them face the dirty world, make them open their eyes to the dangers and make them strong enough to help themselves in any situation,Every morning they wake them up , make breakfast... she does everything with love and only love can handle a kid...they leave for their schools but never come back....no mother wants that.... some beautiful last words by a student
MOM MY SHIRT IS SATINED WITH INK PLEASE DONT SCOLD ME,
MOM IF I GET LATE COMING HOME PLEASE DONT BE ANGRY
MOM TODAY MY SHIRT IS STAINED WITH BLOOD NOT INK... PLEASE DONT CRY 
MOM IF I DONT COME HOME TODAY PLEASE DONT BE SAD
These 9 took 150+ roses from their mothers' favourite garden...(THIS IS NOT MANKIND, THIS IS NOT HUMANITY!! WE MUST FIGHT AGAINST IT)
DAD Goes to office,works hard just to bring money to his home, to provide to his family..eat, sleep under a shelter, school fee and career fee etc... help there children all the way, they cry when they see tear in our eyes, they buy everything we wish for, because the true happiness is in the smile of a son/daughter...they scold there kids to study to go to school,to make and secure their future... but if they go and never come back..will a dad stay calm??..NO! He will shout out his child's name.He will find him everywhere and if he finds them dead.. do u think he will still be alive? Absolutely No!! If your baby ,your piece of heart is not breathing and you are breathing do u think you are alive??

Quotes from a war
IN PEACE A SON BURIES HIS DAD, IN WAR DAD BURIES HIS SON.....
stop this.. stop snatching these little souls 
Mom I told you I feel scared in dark, , PLEASE take me home im scared in the grave.... parents help their babies but at the last breath of these little kids they were shouting out their mothers' name but no one helped them, they tried their best to save themselves but they got shot,blasted, they never knew that today will the last day to see their parents' faces nor did their parents know that today is the last day to see their babies! shinning and smiling faces!!
ALL PAKISTAN LOST HOPE...EVERY PAKISTANI LOST THEIR SONS IN THIS WAR, THEY ARE MARTYRS , THEY ARE, THEY WERE ,THEY WILL BE IN OUR HEARTS ,THE BEST SONS OF PAKISTAN, OF PESHAWAR..MARTYRS NEVER DIES.. they are at the highest rank of jannah, their parents are going to go to jannah wearing blindfolds..Because THE SMALLEST COFFINS ARE THE HEAVIEST!!! ,future of pakistan died,flowers of peshawar have dried out, scents of these little flowers have turned into pour souls, they go to a place from where they will not come back, forever!! today every child every woman and man of pakistan is weeping , they are thinking how to avenge these terrorist, to kill these terrorists with a single bullet is not enough for them ,they should be slaughtered with great agony, my eyes are dry but my heart cries......i m not forgetting you out little angels....still remembering you.

GIVE US OUR CHILDREN ,ITS THE VOICE OF ALL PAKISATANI MOTHERS.

''A wife who loses a husband is called widow.a husband who loses a wife is called widower. a child who loses his parents is called an orphan. there is no words for a parents who loses a child ,that is how awful the loss is.''

Mr. Prime Minister we dont need statements from you. Stop showing your sorrow and stop these sorry statements. Within this week announce hanging of the 500 plus terrorists under custody and hang them publicly. We dont need your wordy statements. The whole nation should ask only one thing ..... Public Hanging of the arrested terrorists.

Our Slogan for the campaign against the terrorism and Terrorists for the Government & the Armed Forced is:

"An Eye for an Eye. Hang Them All, Hang Them High".

Love Pakistan or Leave Pakistan

(WE WANT TO SPREAD THIS ALL OVER THE WORLD, LET THEM KNOW PAKISTAN NEED YOUR HELP.. FIGHT AGAINST THESE CRISIS, RAISE YOUR VOICE JUST FOR THE SAKE OF HUMANITY, JUSTICE AND OUR FUTURE (CHILDREN) HELP US FIGHT THROUGH THIS!
RIP TO ALL THE ANGELS... GOD HELP THEIR WAY THROUGH JANNAH, BRIGHTEN THEIR WAYS)

I Strongly condemn the school attack in peshawar by terrorist.

By Ugmai afridi..

Monday, 15 December 2014

quote of the day


''i am simple & live in reality but i also have my own fantasy world,
There is pain in my eyes but a shine in my smile, I lose alot but still
live to fight another day, Everything around me is down but still I
never lose hope, I am not the best but I always help others to be the
best! That's what I am.''
( I am re-posting these words, i posted them 4 years and a month ago)

Sunday, 14 December 2014

quote of today

'' Sometime you do not have a shoulder to cray but you always have a forehead to put down in sajda and cry because ALLAH is the best listener''