Modelling of surface segregation for palladium alloys in vacuum and gas environments