Giter VIP home page Giter VIP logo

pcg's People

Contributors

chengjunjia avatar

Stargazers

 avatar

Watchers

 avatar  avatar

pcg's Issues

把赫哥生成的1M规则统一格式

赫哥的1M规则集,存在末尾为0,1的问题;
统一格式后分析结果。

对于PC_Visor的TSS代码,运行得到其平均access time的次数。(每个bucket下的item个数的均值、一共有多少组)
然后增加规则mark,再运行得到平均access time的次数。

绘制图

首先得到Matrix结果

def getRuleMatrix(filename):
global logger
rs = pc.load_rules(filename)
start = time.time()
logger.info("="*50)
# Convert rules into the policySpace
rsPolicySpaceList = []
for r in rs:
cur_rule = PolicySpace([HyperRect(deepcopy(r[:5]))])
rsPolicySpaceList.append(cur_rule)
ruleNum = len(rsPolicySpaceList)
logger.info("Finish the PolicySpace Analysis.")
# init the matrix
result = np.matlib.eye(n=ruleNum, dtype=int)
for i in range(1, ruleNum):
curRule = rsPolicySpaceList[i]
for j in range(0, i):
cmpRule = rsPolicySpaceList[j]
if not curRule.and(cmpRule): # curRule /\ cmpRule == None
continue
else:
result[i,j] = result[j,i] = 1
end = time.time()
logger.info("The time runs for {total_time}s".format(total_time=end-start))
return result

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.