The Optimal and Safe Ship Trajectories for Different Forms of Neural State Constraints