edu.unm.cs.cs351.tdrl.f06.p2
Enum CustomerType

java.lang.Object
  extended by java.lang.Enum<CustomerType>
      extended by edu.unm.cs.cs351.tdrl.f06.p2.CustomerType
All Implemented Interfaces:
Serializable, Comparable<CustomerType>

public enum CustomerType
extends Enum<CustomerType>

Represents one of the broad categories of customers that shop at Grell Computers.

Version:
1.0
Author:
terran

Enum Constant Summary
BEIGE_CPA
           
GAMEZ_R_US
           
GRANDMA
           
LEET_HAXOR
           
 
Method Summary
 double getOrderFreq(ComputerOrder o)
           
 double getWalkProb()
          The probability that the customer will walk away rather than changing order.
 ComputerOrder pickOrder(XRandom r)
           
static CustomerType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static CustomerType[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

LEET_HAXOR

public static final CustomerType LEET_HAXOR

GAMEZ_R_US

public static final CustomerType GAMEZ_R_US

BEIGE_CPA

public static final CustomerType BEIGE_CPA

GRANDMA

public static final CustomerType GRANDMA
Method Detail

values

public static final CustomerType[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(CustomerType c : CustomerType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static CustomerType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name

pickOrder

public ComputerOrder pickOrder(XRandom r)

getOrderFreq

public double getOrderFreq(ComputerOrder o)

getWalkProb

public double getWalkProb()
The probability that the customer will walk away rather than changing order. This is invoked once the customer has already decided to issue a change order. With this probability, the change order will be a cancellation; otherwise it will be a change to the existing order. Formally, this is Pr[cancel|CustomerType,isChange=true].

Returns:
Probability that this customer type will decide to walk away rather than change the type of the order.