// File: richardposner[P]BioNetFit2/src/code/Particle.cpp
// Function: Particle::setParam(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double>, unsigned int)
void Particle::setParam(pair<std::string, double> myParams, unsigned int mid){

	/* razi: moved to constructor
	unsigned int gap= mid+1-simParams_.size();
	if (gap>0){   //fill dummy
		std::map<std::string, double> dummyParam;		//dummyParam[""]=0;
		for (int i=0; i < gap; i++)
			simParams_.push_back(dummyParam);//simParams_.push_back(std::map<std::string, double> dummyParam);
	}*/

	if (mid>=simParams_.size())  outputError("setParam failed. Invalid model id:"+toString(mid)+". I am quitting....");
		//Raquel: this code check with the master whether the parameter exists in model
	for (auto p = swarm_->options.models.at(mid)->getFreeParams_().begin(); p != swarm_->options.models.at(mid)->getFreeParams_().end(); ++p) {
		if(p->first == myParams.first) {
				//cout << "Raquel myParams first: " << myParams.first << " second: " << myParams.second << endl;
				simParams_.at(mid).insert(myParams);//Raquel: if it does exist, set the param value
		}//Raquel: otherwise, do nothing
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rsi, -0xc0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
movl -0x14(%rbp), %eax
movq %rax, -0xb0(%rbp)
callq 0xb32b0
movq %rax, %rcx
movq -0xb0(%rbp), %rax
cmpq %rcx, %rax
jb 0xa3d75
movl -0x14(%rbp), %esi
leaq -0x78(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x17e460
movq -0xc8(%rbp), %rdx
leaq 0x137445(%rip), %rsi    # 0x1db120
leaq -0x58(%rbp), %rdi
callq 0x8e0f0
jmp 0xa3ce6
leaq 0x13741f(%rip), %rdx    # 0x1db10c
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x441f0
jmp 0xa3cfc
leaq -0x38(%rbp), %rdi
callq 0x17e420
jmp 0xa3d07
leaq -0x38(%rbp), %rdi
callq 0x311e8
leaq -0x58(%rbp), %rdi
callq 0x311e8
leaq -0x78(%rbp), %rdi
callq 0x311e8
jmp 0xa3d75
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0xa3d67
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0xa3d5e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x311e8
leaq -0x58(%rbp), %rdi
callq 0x311e8
leaq -0x78(%rbp), %rdi
callq 0x311e8
jmp 0xa3e72
movq -0xb8(%rbp), %rax
movq 0xa8(%rax), %rdi
addq $0x14c0, %rdi           # imm = 0x14C0
addq $0x100, %rdi            # imm = 0x100
movl -0x14(%rbp), %eax
movl %eax, %esi
callq 0x45190
movq (%rax), %rdi
callq 0xb31e0
movq %rax, %rdi
callq 0xb3200
movq %rax, -0x90(%rbp)
movq -0xb8(%rbp), %rax
movq 0xa8(%rax), %rdi
addq $0x14c0, %rdi           # imm = 0x14C0
addq $0x100, %rdi            # imm = 0x100
movl -0x14(%rbp), %eax
movl %eax, %esi
callq 0x45190
movq (%rax), %rdi
callq 0xb31e0
movq %rax, %rdi
callq 0xb3310
movq %rax, -0x98(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xb32e0
testb $0x1, %al
jne 0xa3e08
jmp 0xa3e69
leaq -0x90(%rbp), %rdi
callq 0xb3230
movq -0xc0(%rbp), %rsi
movq %rax, %rdi
callq 0x69890
testb $0x1, %al
jne 0xa3e29
jmp 0xa3e56
movq -0xb8(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, %esi
callq 0xb2a00
movq -0xc0(%rbp), %rsi
movq %rax, %rdi
callq 0xb3340
movq %rax, -0xa8(%rbp)
movb %dl, -0xa0(%rbp)
jmp 0xa3e58
leaq -0x90(%rbp), %rdi
callq 0xb3260
jmp 0xa3db2
addq $0xd0, %rsp
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x30170
nopl (%rax,%rax)