~tapaal-dist/verifypn/LTSmin

« back to all changes in this revision

Viewing changes to PetriEngine/Structures/LimitedStateAllocator.h

  • Committer: Jiri Srba
  • Date: 2014-03-18 07:13:31 UTC
  • mfrom: (42.1.5 memoryLimitBug)
  • Revision ID: srba@cs.aau.dk-20140318071331-66nr5ajk4iotuycg
merged in branch fixing memory limit overflow

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
                char* m;
39
39
        } __attribute__((__packed__));
40
40
public:
41
 
        LimitedStateAllocator(const PetriNet& net, int memorylimit = 0){
 
41
        LimitedStateAllocator(const PetriNet& net, int memorylimit = 0){ //  memory limit in MB
42
42
                _nPlaces = net.numberOfPlaces();
43
43
                _nVars = net.numberOfVariables();
44
 
                if(memorylimit != 0)
45
 
                        _blocklimit = ceil(memorylimit / (stateSize() * blocksize));
 
44
                if(memorylimit != 0) 
 
45
                        _blocklimit = ceil(memorylimit*1024.0*1024.0 / (stateSize() * blocksize));
46
46
                else
47
47
                        _blocklimit = -1;
48
48
                _b = NULL;