pagand / model_optimze_vessel

Queen of Oak Bay - visualization/classification/prediction
5 stars 3 forks source link

Create trip dataset #23

Open pagand opened 1 year ago

pagand commented 1 year ago

Create a dataset for the trip According to taxonomy, the data show follow this pattern: dataset = list of trips dictionary trip dictionary keys: observations, next_observations, actions, rewards, termination observation [N, Ns]: N is the total sample size in each trip (H-N or N-H), Ms is the number of features (measured or computed) next_observation [N, Ns]: at each point observation[i+1,Ns] = next_observation[i, Ns] actions [N, Na]: Na is the size of action space rewards [N, 3]: first reward: euclidean distance of latitude and longitude of the average top 1% at each time second reward: scaled of -FE for all the steps + final reward (1) only at the end point third reward: distance to the goal termination [N, 1]: termination [i,1] for all i not equal to N is False, for the last element is True

yim-fan commented 1 year ago

Pedram, can you clarify what would be the features for the observation? Is this the same as the ones I plan to use for the fuel consumption prediction model? What if I want to make any modifications to the features through the training process?

yim-fan commented 1 year ago

code at https://github.com/pagand/model_optimze_vessel/blob/6dc2ee550b5305537fe466b794fbbdaaea0e9094/Prepration/rl_data.ipynb

yim-fan commented 1 year ago

I also share the pickle file with you via google drive, to load:

with open('rl_data.pickle', 'rb') as handle: rl_data = pickle.load(handle)

yim-fan commented 1 year ago

For features, I choose 'DEPTH', 'LATITUDE', 'LONGITUDE', 'SOG', 'MODE', 'season', 'weekday', 'current', 'direction', 'rain', 'snowfall', 'weathercode', 'is_weekday', 'effective_wind', 'adversarial', 'SPEED', 'resist_ratio' For actions, I choose 'HEADING' and 'TORQUE'.

If you are interested, I can also create another dataset that use SPEED or POWER for action. Current version also includes adversarial trips, and have 'adversarial' column to specify if this is adversarial or not.

Please let me know if you need more revision on this dataset.

pagand commented 1 year ago

@yim-fan If you change the features at anypoint during training, please go ahead and update the pickle file as well. Always make the latex pickle file available and let me know when you change it. I have a few questions: 1- what is the effective_wind_factor and effective_wind? and which one is included? 2- Whenever the finial edits are done, please update the github so I review https://github.com/pagand/model_optimze_vessel/blob/6dc2ee550b5305537fe466b794fbbdaaea0e9094/Prepration/rl_data.ipynb

yim-fan commented 1 year ago

effective_wind_factor and effective_wind are calculated as you did in your previous paper: effective wind factor is the difference between wind angle and vessel heading in radian, and effective wind is the wind speed times effective wind factor.

In the current model, I used effective wind, but I also have calculated wind force and wind direction, which according to my literature review, is a lot others have done in their paper. These two fields are calculated by wind speed squared and wind angle categorized into head, wind tail wind, and side wind. Later I will also use wind force and wind direction to substitute effective wind, and compare the performance.

RL dataset progress:

yim-fan commented 1 year ago

The rl data generator in GitHub is updated. View at https://github.com/pagand/model_optimze_vessel/blob/e2e15ca9f0b4d50d3bfef7f015694276b22b654c/Prepration/rl_data.ipynb The newest version of pickle file is also available at: google drive: https://drive.google.com/file/d/1-Jv3eVDTPxNTnOointRZGYpfA3lc6mti/view?usp=sharing