added PatternSetModel.write()