def __parse_world(<EOL>world, radius=None, species_list=None, max_count=None,<EOL>predicator=None):
from ecell4_base.core import Species<EOL>if species_list is None:<EOL><INDENT>species_list = [<EOL>p.species().serial() for pid, p in world.list_particles()]<EOL>species_list = sorted(<EOL>set(species_list), key=species_list.index)  <EOL><DEDENT>species = []<EOL>for name in species_list:<EOL><INDENT>particles = [<EOL>{'<STR_LIT>': p.position(), '<STR_LIT:r>': p.radius()}<EOL>for pid, p in world.list_particles(Species(name))<EOL>if predicator is None or predicator(pid, p)]<EOL>if len(particles) == <NUM_LIT:0>:<EOL><INDENT>continue<EOL><DEDENT>if max_count is not None and len(particles) > max_count:<EOL><INDENT>particles = random.sample(particles, max_count)<EOL><DEDENT>data = {<EOL>'<STR_LIT:x>': [p['<STR_LIT>'][<NUM_LIT:0>] for p in particles],<EOL>'<STR_LIT:y>': [p['<STR_LIT>'][<NUM_LIT:1>] for p in particles],<EOL>'<STR_LIT:z>': [p['<STR_LIT>'][<NUM_LIT:2>] for p in particles]<EOL>}<EOL>r = max([p['<STR_LIT:r>'] for p in particles]) if radius is None else radius<EOL>r = r if r > <NUM_LIT:0> else min(world.edge_lengths()) * <NUM_LIT><EOL>size = <NUM_LIT> / max(world.edge_lengths()) * r<EOL>species.append({<EOL>'<STR_LIT:name>': name,<EOL>'<STR_LIT:data>': data,<EOL>'<STR_LIT:size>': size<EOL>})<EOL><DEDENT>return species<EOL>
Private function to parse world. Return infomation about particles
(name, coordinates and particle size) for each species.