Daily report¶

This notebook is intended to showcase the automatic daily report algorithm. We will initialize the class and explore the different possibilities we have.

Required folder and data structure¶

The required folder structure, where 'data' folder is top level:

data/                  <-- This is the top-level directory
└── GPSData/           <-- This is the second-level directory
    ├── trips/         <-- These are third-level directories
    └── tripInfo/      <-- These are third-level directories

Folder 'trips' and 'tripsInfo' should contain GPS files on form MM-DD-YYYY.csv with columns:

  • trips: TripLogId, Timestamp, Latitude, Longitude, Uncertainty
  • tripsInfo: TripLogId, DumperMachineNumber, MachineType, LoadLongitude, LoadLatitude, DumpLongitude, DumpLatitude, MassTypeMaterial, Quantity

We begin by loading necessary libraries, including our class (which can be found in daily_report.py).

In [ ]:
!pip install -r requirements.txt
In [ ]:
from daily_report import DailyReport
import plotly
plotly.offline.init_notebook_mode()
GPS_DATA_DIRECTORY = "data/GPSData"

Using the class requires only the specification of a date, i.e. a day that would be of interest to gather insight about activity.

In [ ]:
date = "04-26-2022"  # MM-DD-YYYY
daily_report = DailyReport(date, gps_data_dir=GPS_DATA_DIRECTORY)

Mass Moved¶

An Interactive plot showcasing the activity for the day. Choose the machine type and the desired amount of dump and load clusters. Click on specific dump and load zones to display the mass moved.

In [ ]:
daily_report.interactive_map.plot_interactive_map(jupyter=True)

Make a static version of the interactive map in the current state by running the next cell. (For website display purposes)

In [ ]:
daily_report.interactive_map.plot_static_map()
MYMAP
Day Overview, 04-26-2022
Total mass moved for the day by Truck: 7953.3 t
Stone: 7770.299999999997 t, Soil: 151.0 t, Equipment: 32.0 t, Other: 0 t
Top 5 mass transfer zones for the day
L3->D1: 1464.9 t
L6->D2: 1357.0 t
L8->D0: 1036.9 t
L6->D1: 816.0 t
L0->D0: 663.0 t
Top 3 workers of the day
Nr.1 ID: 24 moved 154.8 t of mass moved per hour
Nr.2 ID: 11 moved 149.4 t of mass moved per hour
Nr.3 ID: 30 moved 144.0 t of mass moved per hour

One can also look at the productivity, expressed by tons per hour that the machine has been in activity. We split the productivity by type of load as well. The last trip has been excluded, because of varying practices of reporting.

In [ ]:
daily_report.compute_productivity()
daily_report.plot_productivity()
In [ ]:
daily_report.print_total_productivity()
+-----------------+--------------+
| Material Type   |   Total t/hr |
+=================+==============+
| Stone           |       798.37 |
+-----------------+--------------+
| Equipment       |       101.1  |
+-----------------+--------------+
| Soil            |       124.25 |
+-----------------+--------------+
| 4               |         0    |
+-----------------+--------------+

Idle Time¶

Specifying a machine type of interest, we can compute idle times and make various plots.

In [ ]:
choosen_machine_type = 'Truck' # Truck | Dumper
daily_report.compute_idle_times(choosen_machine_type)
daily_report.aggregated_idle_timeline()
Computing idle times for  Truck
100%|██████████| 17/17 [00:12<00:00,  1.32it/s]
Finished!

Our first plot will be a plot of the number of machines idle at any given moment.

In [ ]:
daily_report.plot_aggregated_idle_timeline()

Inspecting the above plot, we notice a peak of 15 idle machines. We can plot maps of the times corresponding to the peak idle times to investigate where the idle machines are positioned. At the same time, we can get an idea about their status by looking at the icon. An excavator signifies a machine (truck or dumper, depending on the previous choice) whose next expected activity is to be loaded. A tipping truck signifies a machine whose next expected activity is to dump. Let us look at the time we reached the peak of 15 idle machines. Choose static=True for .html compatible output.

In [ ]:
daily_report.plot_peak_times(1, static=True)

Finally, we can look at a heatmap of all idle positions for all machines of the selected type for the selected day.

In [ ]:
daily_report.plot_idle_heatmap(static = True)