|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ciagent.CIAgent | +--pamanager.AirfareAgent
The AirfareAgent
class implements an agent that determines if
desirable flights are available based on the departure time, the return time,
and the cost of the tickets.
Field Summary | |
protected java.lang.String |
actionString
|
protected java.lang.String |
departDay
|
protected java.lang.String |
departMonth
|
protected RuleVariable |
departs
|
protected java.lang.String |
destCity
|
protected java.lang.String |
origCity
|
protected RuleVariable |
price
|
protected BooleanRuleBase |
rb
|
protected java.lang.String |
returnDay
|
protected java.lang.String |
returnMonth
|
protected RuleVariable |
returns
|
Fields inherited from class ciagent.CIAgent |
agentPlatform,
children,
DEFAULT_ASYNCTIME,
DEFAULT_SLEEPTIME,
name,
parent,
traceLevel |
Constructor Summary | |
AirfareAgent()
Creates an AirfareAgent instance. |
|
AirfareAgent(java.lang.String name)
Creates an AirfareAgent instance with the given name. |
Method Summary | |
java.lang.String |
getActionString()
Retrieves the actionString this agent sends in events. |
java.lang.String |
getDepartDay()
Retrieves the day of the departure date for a flight. |
java.lang.String |
getDepartMonth()
Retrieves the month of the departure date for a flight. |
java.lang.String |
getDestCity()
Retrieves the destination city for a flight. |
java.lang.String |
getOrigCity()
Retrieves the departure city for a flight. |
java.lang.String |
getReturnDay()
Retrieves the day of the return date for a flight. |
java.lang.String |
getReturnMonth()
Retrieves the month of the return date for a flight. |
java.lang.String |
getTaskDescription()
Retrieves a formatted string for display of this agent's current task. |
void |
initFlightRuleBase()
Initializes the Flight rule base that is used by the agent when evaluating the flight information. |
void |
initialize()
Initializes the agent by initialing the rule base. |
void |
process()
Provides the default behavior of this agent which includes going out to a web page to get airfare information, parsing that page, and determining whether the flights and airfares are within certain limits set in the rule base. |
void |
processCIAgentEvent(CIAgentEvent e)
Processes an event by invoking the default behavior of this agent. |
void |
processTimerPop()
Processes a timer pop which does nothing in this case. |
void |
setActionString(java.lang.String actionString)
Sets the action string to be sent by this agent in an EVENT. |
void |
setDepartDay(java.lang.String departDay)
Sets the day of the departure date for a flight. |
void |
setDepartMonth(java.lang.String departMonth)
Sets the month of the departure date for a flight. |
void |
setDestCity(java.lang.String destCity)
Sets the destination city for a flight. |
void |
setOrigCity(java.lang.String origCity)
Sets the departure city for a flight. |
void |
setReturnDay(java.lang.String returnDay)
Sets the day of the return date for a flight. |
void |
setReturnMonth(java.lang.String returnMonth)
Sets the month of the departure date for a flight. |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected java.lang.String departMonth
protected java.lang.String departDay
protected java.lang.String origCity
protected java.lang.String destCity
protected java.lang.String returnMonth
protected java.lang.String returnDay
protected BooleanRuleBase rb
protected RuleVariable departs
protected RuleVariable returns
protected RuleVariable price
protected java.lang.String actionString
Constructor Detail |
public AirfareAgent()
AirfareAgent
instance.public AirfareAgent(java.lang.String name)
AirfareAgent
instance with the given name.name
- the String that contains the name of the agentMethod Detail |
public void setDepartMonth(java.lang.String departMonth)
departMonth
- the String that contains the three letter abbreviation
for the month (JAN, FEB, MAR, APR, etc.)public java.lang.String getDepartMonth()
public void setDepartDay(java.lang.String departDay)
departDay
- the String that contains the number of day of the monthpublic java.lang.String getDepartDay()
public void setReturnMonth(java.lang.String returnMonth)
returnMonth
- the String that contains the three letter abbreviation
for the month (JAN, FEB, MAR, APR, etc.)public java.lang.String getReturnMonth()
public void setReturnDay(java.lang.String returnDay)
returnDay
- the String that contains the number of day of the monthpublic java.lang.String getReturnDay()
public void setOrigCity(java.lang.String origCity)
origCity
- the String that contains the three letter airport code for
the departure city (RST, MSP, ORD, etc.)public java.lang.String getOrigCity()
public void setDestCity(java.lang.String destCity)
destCity
- the String that contains the three letter airport code for
the destination city (RST, MSP, ORD, etc.)public java.lang.String getDestCity()
public void setActionString(java.lang.String actionString)
actionString
- the integer that represents the actionpublic java.lang.String getActionString()
public java.lang.String getTaskDescription()
public void initialize()
public void process()
public void processCIAgentEvent(CIAgentEvent e)
e
- the CIAgentEvent objectpublic void processTimerPop()
public void initFlightRuleBase()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |