TRUCK AGENT SCHEDULING
 
   
  INTRODUCTION

      Truck Agent scheduling application is a scheduling application based on the concept of multi agents system. This application can be used in company which working in delivering order. The basic idea of the mechanism of this program is as follow:

There is a queue of orders to be picked up in one particular place and delivered to another place. Each order will be offer to all of truck that available on that time. Each truck will calculate the cost for picking up and delivering. Then, send a proposed cost to the company. After company accept all the proposed cost, it will identify the truck with the minimum cost as a winner for this order. We can see that this system is similar with reverse auction. Hence, every truck will bid the order with as lowest cost as possible. The truck, which can offer the lowest cost, is the winner.

If there is no order that is offered by company, trucks will communicate each other for exchanging an order. We can see this process similar as market place where people buying and selling goods. Here is a brief description of how and when they are allowed to exchange the order. There is a list of order that has been taken by particular truck. We use a term list of contract for this list. While there is no order offered by company, each truck can look up to the list of contract that has been awarded to others Truck. On one hand, truck may sell its contract to other truck that can offer cheaper cost. On the other hand, truck may buy other contract if he can offer better cost.

Programming tool that is used to implement this program is JBuilder4. Hence, this program has to be run on JBuilder4.


CLASS OUTLINE
CLASS FOR SERVER

 
  1. TruckSchedulingApplication
    TruckSchedulingApplication class is a main class of this application.

2. SplashScreen
    The purpose of this class is for a welcome window, which will be show up for few     seconds when the application starts.

3. ServerGUI
    The purpose of this class is for main UI (User Interface) in this application.
    It has some panel, which are OrderPanel, DisplayPanel, TruckPanel, and Data     Panel.

4. ServerGUI_AboutBox
    The purpose of this class is for displaying an information box about this     application.

5. OrderFormPanel
    The purpose of this class is for displaying an order form. This form is to enter     information about new order.

6. DisplayPanel
    The purpose of this class is for displaying how the order is distributed.

7. TruckFormPanel
    This panel is a canvas for addTruckPanel, ModifyTruckPanel, and     DeleteTruckPanel.

8. AddTruckPanel
    The purpose of this class is a UI for add a new truck record.

9. ModifyTruckPanel
    The purpose of this class is a UI for modify a truck record.

10. DeleteTruckPanel
      The purpose of this class is a UI for deleting a truck record

11. TruckFileManager
      The purpose of this class is for managing a TruckList.dat file. All the function in       this class is for manage a record such as add record, delete record, etc.

12. CostFormPanel
      This panel is a canvas for AddCostPanel, ModifyCostPanel, and DeleteCostPanel.

13. AddCostPanel
      The purpose of this class is UI for add a new cost record.

14. ModifyCostPanel
      The purpose of this class is UI for modify a cost record.

15. DeleteCostPanel
      The purpose of this class is UI for deleting a cost record.

16. DialogBox
      This class is for dialog box when user do something not right.

17. CompanyAgent
      This class is representing an object of CompanyAgent (server).

18. Bid
      This class is representing an object of each bid that the Truck made.

19. TruckHandler
      This is a thread class for server.

20. TruckHandlerList
      This class is a list of truck thread.

21. OrderQueue
      This class is using a prototype of priority queue. When a new order arrive, it will       be put in the queue by the sending date and time.

22. Order
      This class is represented an object of order.

23. TakenOrderList
      This class is using Linked List prototype for list of order that has been taken.
 
   
  CLASS FOR CLIENT  
    1. TruckAgentGUI
    The purpose for this class is as main UI for client (truck agent)

2. TruckAgent
    This thread class is representing an object of truck. This class will have relation     with TruckHandler class.

3. CostFileManager
   The purpose of this class is for managing a CostList.dat file. All the function in this    class is for manage a record such as add record, delete record, etc.

4. Contract
   This class is representing an object of every successful bid of truck

5. Region
   This class is an object that will be used in CostFileManager.
 
   
  DATA DICTIONARY
Data Files
 
  · TruckList.dat
· CostList.dat
 
  Image Files  
  · Logo.jpg
· TruckAgent.jpg
 
  Source Code Files  
  · TruckSchedulingApplication.java
· SplashScreen.java
· ServerGUI.java
· ServerGUI_AboutBox.java
· OrderFormPanel.java
· DisplayPanel.java
· TruckFormPanel.java
· AddTruckPanel.java
· ModifyTruckPanel.java
· DeleteTruckPanel.java
· TruckFileManager.java
· CostFormPanel.java
· AddCostPanel.java
· ModifyCostPanel.java
· DeleteCostPanel.java
· DialogBox.java
· CompanyAgent.java
· Bid.java
· TruckHandler.java
· TruckHandlerList.java
· OrderQueue.java
· Order.java
· TakenOrderList.java
· TruckAgentGUI.java
· TruckAgent.java
· CostFileManager.java
· Contract.java
· Region.java
 
  Import Class  
  · java.awt.*
· javax.swing.*
· com.borland.jbcl.layout.*
· java.awt.event.*
· javax.swing.event.*
· java.net.*
· java.io.*
· java.util.*
· java.text.*
 
 
 
  MANUAL
· When an application is started, the welcome window (figure 1) will show up for few   second
 
 
(figure 1)
 
  · Next the main window (figure 2) will come up. This window has 4 panel : Order Panel,   Display Panel, Truck Panel and Data Panel.
 
 
(figure 2)
 
  · Order Panel (figure 2) for input information about new arrival order. Once, the user   pressed a "Put In The Queue" button, the order will be announced to all of available   truck. All of the field MUST be filled. We can see the assignment of order to the truck in   the "Display Panel"(figure 3).
 
 
(figure 3)
 
  · Start button is for connecting a truck to the server. Once, start button is pressed,   the name of this button will be changed to be 'Unavailable' (figure 4). Hence, the   function of this button is now for disconnecting the truck from server.
 
 
(figure 4)
 
  · In the Tour Plan text area (in figure 4), we can see that there is an initial position for   every truck. For example : Initial position of truck 1 is Region 1.
· For example : There is one new order arriving which is Order 1. In this case, Order 1 is   awarded to Truck 1 since Truck 1 offers the cheapest cost for this order.
 
 
(figure 5)
 
  · If Truck delivers the orders, "deliver button" should be pressed (figure 6). Therefore, all   of the order in the winning order text area will be cleared. If Truck is not available, we   should push "Unavailable button". The name of this button will change to be "start".   (figure 7)
 
 
(figure 7)
 
  · For example : another new order is arriving and the winner is truck 2.(figure 8)
 
 
(figure 8)
 
  · At an example above, Truck 1 is not participating for bidding order 1 since it is not   available for some reason. Say, that now truck 1 is available again. And Truck 1 can   offer the better cost for order1 than truck 2. Hence, Order 1 will be gave to truck 1.   (figure 9)
 
 
(figure 9)
 
  · Truck Panel is UI for add, modify, and delete truck records. First, there are 3 buttons:   Add Truck (figure 10) , Modify Truck(figure 11), Delete Truck.
· Add Truck: Number for truck will be generated automatically by the system.
 
 
(figure 10)
 
  · Modify/Delete Truck Record : Insert truck no that we want to modify then press find   button. Then the record will be shown up. You can change the record and then press   save button.
 
 
(figure 11)
 
  · Data Panel is UI for insert record about the journey cost from 1 place to another. What   you have to do is insert 2 name of position and the cost then save it. You can add new   record, modify the record and delete a record. The system is similar as Truck Panel.
 
 
(figure 12)