<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write(self, file):
 """ Writes market experiment data to file in ReStructuredText format. """

        # Write environment state data.
        file.write("State\n")
        file.write( ("-" * 5) + "\n")
        self.writeDataTable(file, type="state")

        # Write action data.
        file.write("Action\n")
        file.write( ("-" * 6) + "\n")
        self.writeDataTable(file, type="action")

        # Write reward data.
        file.write("Reward\n")
        file.write( ("-" * 6) + "\n")
        self.writeDataTable(file, type="reward")