To the OP, this isn't off topic, but it may seem that way. Bear with me and you'll see how it fits.
coltle6920,
I wasn't talking down to you, just trying to ascertain your level of knowledge before I went into a discussion that might be meaningless by using terminology that you'd be unfamiliar with. Sorry, I didn't mean to come off that way.
Jeff Cooper used colors, but the NRA uses verbiage. I will use both:
Unaware(white):
This is where most people in the US live. They are walking around without a care and not paying attention to the world around them. Another term would be, asleep.
Aware(yellow):
This is how we want to be. An aware person is constantly surveying his surroundings. Not nervously, but just noticing things and people. Less likely to have someone sneak up on you.
Alert(orange):
You have noticed a potential threat. You don't know that it is a threat yet, but it could turn into one at any moment. It's the middle of July in Phoenix and a guy just walked in wearing a floor length trench coat. Hmmm, could be an issue. It's at this point you start to formulate/finalize an action plan. If he does this, I'm doing that. Look for exits, cover. Know what you'll do with your family or friends.
Alarm(red):
The guy in the trench coat pulls out a shotgun. Now you have to do something. Put your plan into action. Exit if you can, get behind cover if you can't. Your plan should have included Thresholds, limits on when you'll do what. For example: you see some suspicious characters on the opposite side of the street. If they cross to your side(threshold), you cross to the other. Notice that the action plan didn't necessarily include force. However, you need another threshold. What if they cross back? What if you can't cross? You need to have set some level to let you know when to use force, only if necessary.
Back to the restaurant scenario:
"You are in a crowded restaurant.You are either alone or with friends/family and a armed robber enters the building."
You are in condition Alert(yellow) when he walks in because you've noticed him. Most would not. So, upon noticing the Bad Guy(BG), you ratchet to condition Alarm(orange). You formulate a plan. Can you, and your family/friends, get away? If so, how? Where are the exits? You made note of them on the way in, right? Leaving is the best plan if possible.
As you're in Alert(orange) you need to stay in Aware(yellow). What? How can I do that? The idea is to stay alert for other threats. Did the BG have an accomplice that you didn't notice at first? Don't become so focused on the potential threat that you miss the real threat. What if the guy with the trench coat is just a weirdo and not really a threat? Did you miss the guy with the gun while you were focused on the trench coat?
In this scenario though, the trench coat really is a bad guy and pulls his gun. Ratchet to condition Alarm(red). Now you have to do something. Getting behind cover is a good idea, leaving is better. Your first thoughts have to be toward yourself and family. If they are safe, then consider others. The BG points his gun at the teller. Do you shoot him? CAN you shoot him? Remember, this is a crowded restaurant. What about the people around you? If you shoot, will you hit them? What if your round goes through him? Who's on the other side? Does he have a partner? If he does, do you have enough ammo to engage two (told you it would get around to number of rounds)? Do you have the training to handle two assailants? Most don't.
"What if" scenarios are how we learn. They help us develop preliminary plans so we don't have to start from scratch when we need to use a plan for real. They are great learning tools. But, they are never cut and dry. They are never simple. There is never one answer. This is why we train. This is why we practice what we train. If you carry a gun for self defense and have not sought training, start looking. The training is every bit as important, probably more so, as the gun.
"Owning a gun doesn't make you armed any more than owning a guitar makes you a musician." -Col Jeff Cooper
The levels of awareness dictate how we react. They are important to know because we live them even when we don't know what they are. They are the way to formulate the plan we will use in any scenario. So, how would you react in the scenario you posed?