// File: richardposner[P]BioNetFit2/src/code/Particle.cpp
// Function: Particle::Particle(Swarm*, int)
Particle::Particle(Swarm * swarm, int id) {
	id_ = id;
	swarm_ = swarm;

	//razi: init vectors corresponding to multiple models
	unsigned int nModel = swarm_->getNumModels();
	if(nModel < 1) outputError("Can not create particle without a model.");
	models.clear();
	subParticles.clear();
	dataFiles_.clear();
	simParams_.clear();
	fitCalcs.clear();

	//razi: fill with dummay fileds
	std::map<std::string, std::map<int, Data*> > dummyFile;
	std::map<std::string, double> dummyParam;
	std::map<int, double> dummy_fit;
	for (unsigned int i=0; i< nModel; i++){
		subParticles.push_back(0);
		dataFiles_.push_back(dummyFile);
		models.push_back(0);
		simParams_.push_back(dummyParam);
		fitCalcs.push_back(dummy_fit);
	}


	objFuncPtr = 0;
	currentGeneration_ = 1;
	island_ = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x108(%rbp)
movq %rdi, %rax
movq %rax, -0x138(%rbp)
callq 0xb1fb0
movq -0x108(%rbp), %rdi
addq $0x18, %rdi
movq %rdi, -0x130(%rbp)
callq 0xb1fd0
movq -0x108(%rbp), %rdi
addq $0x48, %rdi
movq %rdi, -0x128(%rbp)
callq 0xb1ff0
movq -0x108(%rbp), %rdi
addq $0x60, %rdi
movq %rdi, -0x120(%rbp)
callq 0xb2010
movq -0x108(%rbp), %rdi
addq $0x78, %rdi
movq %rdi, -0x118(%rbp)
callq 0xb2030
movq -0x108(%rbp), %rdi
addq $0x90, %rdi
movq %rdi, -0x110(%rbp)
callq 0xb2050
movq -0x108(%rbp), %rax
movb $0x0, 0xb8(%rax)
movl -0x14(%rbp), %ecx
movl %ecx, 0x40(%rax)
movq -0x10(%rbp), %rcx
movq %rcx, 0xa8(%rax)
movq 0xa8(%rax), %rdi
callq 0x8dec0
movl %eax, -0xfc(%rbp)
jmp 0xa3049
movl -0xfc(%rbp), %eax
movl %eax, -0x18(%rbp)
cmpl $0x1, -0x18(%rbp)
jae 0xa30e6
leaq -0x49(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x30a70
movq -0x140(%rbp), %rdx
leaq 0x137b0e(%rip), %rsi    # 0x1dab88
leaq -0x48(%rbp), %rdi
callq 0x44470
jmp 0xa3085
leaq -0x48(%rbp), %rdi
callq 0x17e420
jmp 0xa3090
leaq -0x48(%rbp), %rdi
callq 0x311e8
leaq -0x49(%rbp), %rdi
callq 0x311c0
jmp 0xa30e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xa3298
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xa30d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x311e8
leaq -0x49(%rbp), %rdi
callq 0x311c0
jmp 0xa3298
movq -0x138(%rbp), %rdi
addq $0x78, %rdi
callq 0xb2070
movq -0x138(%rbp), %rdi
addq $0x48, %rdi
callq 0xb2090
movq -0x138(%rbp), %rdi
addq $0x90, %rdi
callq 0xb20b0
movq -0x138(%rbp), %rdi
callq 0xb20d0
movq -0x138(%rbp), %rdi
addq $0x18, %rdi
callq 0xb20f0
leaq -0x80(%rbp), %rdi
callq 0xb2110
leaq -0xb0(%rbp), %rdi
callq 0x8de30
leaq -0xe0(%rbp), %rdi
callq 0xb2130
movl $0x0, -0xe4(%rbp)
movl -0xe4(%rbp), %eax
cmpl -0x18(%rbp), %eax
jae 0xa3243
movq -0x138(%rbp), %rdi
addq $0x48, %rdi
movq $0x0, -0xf0(%rbp)
leaq -0xf0(%rbp), %rsi
callq 0xb2150
jmp 0xa3193
movq -0x138(%rbp), %rdi
addq $0x90, %rdi
leaq -0x80(%rbp), %rsi
callq 0xb2180
jmp 0xa31ac
movq -0x138(%rbp), %rdi
addq $0x78, %rdi
movq $0x0, -0xf8(%rbp)
leaq -0xf8(%rbp), %rsi
callq 0xb21f0
jmp 0xa31d0
movq -0x138(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0xb2220
jmp 0xa31e5
movq -0x138(%rbp), %rdi
addq $0x18, %rdi
leaq -0xe0(%rbp), %rsi
callq 0xb2290
jmp 0xa31fe
jmp 0xa3200
movl -0xe4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe4(%rbp)
jmp 0xa3160
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0xb2300
leaq -0xb0(%rbp), %rdi
callq 0x8de70
leaq -0x80(%rbp), %rdi
callq 0xb2320
jmp 0xa3298
movq -0x138(%rbp), %rax
movq $0x0, 0x38(%rax)
movq $0x0, 0x30(%rax)
movl $0x1, 0xb0(%rax)
movl $0x1, 0xb4(%rax)
leaq -0xe0(%rbp), %rdi
callq 0xb2300
leaq -0xb0(%rbp), %rdi
callq 0x8de70
leaq -0x80(%rbp), %rdi
callq 0xb2320
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq -0x110(%rbp), %rdi
callq 0xb2340
movq -0x118(%rbp), %rdi
callq 0xb23a0
movq -0x120(%rbp), %rdi
callq 0xb2400
movq -0x128(%rbp), %rdi
callq 0xb2460
movq -0x130(%rbp), %rdi
callq 0xb24c0
movq -0x108(%rbp), %rdi
callq 0xb2520
movq -0x20(%rbp), %rdi
callq 0x30170
nopl (%rax)