The berth allocation is the primary problem of the berth scheduling system, which is an important one in the container terminal. This paper regards total planning delay time of vessels in the terminals as service measure, introduces buffer time as robust measure and proposes the model of robust and discrete berth allocation based on ant colony optimization. In the model the physical conditions and handling capability of the berths is taken into account and the trade-off between the service and robustness of berth allocation planning. The paper applies ant colony optimization to solve the model. The simulation tests reveal that the robust berth allocation plan through the method in this dissertation has the significantly better ability of anti-disturbance than that by the traditional method under the uncertain environment.