move everything to blockManagerState; sim

This commit is contained in:
Jae Kwon
2014-08-03 15:50:28 -07:00
parent 666122861c
commit 8db5b7b614
7 changed files with 886 additions and 181 deletions

View File

@ -12,11 +12,11 @@ func NewHeap() *Heap {
return &Heap{pq: make([]*pqItem, 0)}
}
func (h *Heap) Len() int {
func (h *Heap) Len() int64 {
return len(h.pq)
}
func (h *Heap) Push(value interface{}, priority int) {
func (h *Heap) Push(value interface{}, priority int64) {
heap.Push(&h.pq, &pqItem{value: value, priority: priority})
}
@ -44,7 +44,7 @@ func main() {
type pqItem struct {
value interface{}
priority int
priority int64
index int
}
@ -78,7 +78,7 @@ func (pq *priorityQueue) Pop() interface{} {
return item
}
func (pq *priorityQueue) Update(item *pqItem, value interface{}, priority int) {
func (pq *priorityQueue) Update(item *pqItem, value interface{}, priority int64) {
heap.Remove(pq, item.index)
item.value = value
item.priority = priority