Ship behavior during encounters in ports and waterways based on AIS data