A dynamic job shop scheduling problem where jobs are transported by automated guided vehicles (AGVs) is considered to minimize the mean flow time. This problem is first modeled with a timed Petri net (TPN) which is widely used for modeling and analyzing discrete event systems. A firing rule of transitions in a TPN is modified to derive more efficient schedules by considering jobs that have not arrived yet and restricting the unnecessary movement of the AGVs. We propose a Monte Carlo Tree Search (MCTS)-based algorithm for the problem, which searches for schedules in advance within a time given limit. The proposed method shows better performance than combinations of other dispatching rules.