An inkjet printer enables flexibly controlling nozzle maintenance of nozzles that eject ink according to individual user needs. A scheduler is built into each collaborative agent which schedules tasks allocated to that particular agent and tasks sub-allocated by the agent. The carriage is accelerated to reach the start position of printing of the next line at a predetermined speed. In the case of a closing state of the cover, the hollow trough cover can be connected to the open-top hollow tube of the container tube.