设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14143|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) j9 }  i7 V4 i- `: @* f; I2 |
: `4 K# a# [' a# d6 h3 N- n6 [
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。- L, U0 Z8 K# F3 K
1 S; R* J' r+ [0 n  a& d8 A9 K
begin P_read arriving# v- g: s" Q. G9 d+ y
    while 1=1 do begin
6 {. s+ R/ e2 g7 O. j$ e; ^/ u        read A_tote from "data.txt" with delimiter "\n"
& ~  w5 r* Y6 E" i        read A_time from "data.txt" with delimiter "\n"
( }" z& _. P; a        read A_leave from "data.txt" with delimiter "\n"
" l4 d, ^8 F9 d( o& C; \        read A_picks from "data.txt" with delimiter "\n"
. A: t2 T" \2 }! e% t! T        set load type to A_tote
- G; z' b/ i2 }; R1 F1 J        if A_tote="tote 1" then set A_induct to 1
' {1 E* b, K+ ~, m        else if A_tote="tote 2" then set A_induct to 2# ?* H" r7 j3 J
            else set A_induct to 3    % Q3 G! u# s0 K
        set A_i to 0
+ a' s# E7 K, t$ P        clone 1 load to P_induction
$ V0 T) h: s% P* o6 S+ U        wait for A_time sec
8 L% Q! l: o( e- _' N    end
+ q* a- ]" s' ?end
. \, Y, r$ v/ Z+ g9 R) g2 x# S8 A$ o* R. o& V) p3 b* G. _
begin P_induction arriving: p3 @& O  ?2 r. P& b, T
    if A_induct=1 then clone 1 load to P_pick1
9 C: r$ T9 Q# a# f* x% ^- b9 C! z    else if A_induct=2 then clone 1 load to P_pick2
2 [; Q+ B  o4 D. s        else clone 1 load to P_pick3
7 [$ g5 X1 n$ f) `end- N# x+ e3 M2 R; K
5 J/ w4 ~" z4 d# \9 r2 k
begin P_pick1 arriving* e& q" _: Z6 R* u- e
    set A_i to 1# r- K( Q; _8 c$ _" l
    move into Q_induct1" i$ @! d8 G) L5 @2 y. M6 u
    move into pickaisle.induct14 M$ n/ j4 M8 v8 y6 x& w" x6 _9 @
    while A_i<=30 do begin0 S1 F7 P4 O# Q" H% _# H
        travel to pickaisle.con(A_i)2 Q  E% n0 b$ D5 o9 T9 [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ y6 s( d2 {1 n4 P; D# a: k- p        else wait for 10 sec
8 k/ x7 W1 c" @5 w" H        if A_i=A_leave then send to die& }  q6 E, S1 c; `4 X
        else inc A_i by 1
9 D6 n) a8 G3 }5 W' N' B& g    end, t0 C3 r6 ?7 R6 h; h" \. x
end
8 g5 t, S1 A% `, e0 B( `, B7 D0 Z% S5 B
begin P_pick2 arriving
  Q. X, p( t/ P6 j2 g    set A_i to 11( _2 k& N/ f9 ]# _
    move into Q_induct21 q7 N# P- N) D% Z4 ?" K, i
    move into pickaisle.induct20 t' D4 i. e1 W( o5 O% U! O
    while A_i<=30 do begin
$ F9 ^- v% {) O9 ?  V' {        travel to pickaisle.con(A_i): Z2 n- p: X6 T$ L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 Q* E9 R0 ^+ z- i; x8 {
        else wait for 10 sec# t; ^& X# ~6 l% n* ]
        if A_i=A_leave then send to die- ^" `/ p! n' D0 M, j
        else inc A_i by 1" Q5 T+ Z; m9 \1 F- V
    end' A' m7 H& @% }- A
end
1 @  M/ E/ ^) x6 N8 [# a+ R* e( P
8 B9 }6 E" A. _( u9 i6 P* {, G& bbegin P_pick3 arriving
7 K1 D8 }! d$ v( o7 H    set A_i to 21' e9 i9 ]% A2 W, B
    move into Q_induct3! t" l% l- n( I, x# ^& O3 t0 U. Q
    move into pickaisle.induct3
# z: y( d9 W' G8 E    while A_i<=30 do begin
. p* O& M8 J: y1 s        travel to pickaisle.con(A_i)
; T$ w6 U5 T6 B9 G4 Z8 j4 v5 @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 E, f+ m( K) x4 q* p
        else wait for 10 sec
* h; r2 K8 X5 a  s, K/ K. `        if A_i=A_leave then send to die
) j. i7 P: k6 e" O) c        else inc A_i by 1
4 P# J/ s! o" ^  L  \    end* V" K$ J+ O: Q( o! a2 \1 D6 Q
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?
( c; n+ a0 g! r" ^- h6 \; ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( t) a, X9 J8 u, v8 a" r. D$ ~8 W) ~" x/ {8 G* A0 z" k
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
/ O* {- L, t. j5 i) c  w: X7 n# I: S& o5 ^: \
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ v1 J5 e( ]7 p  G
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;& i5 G7 S/ r3 ~$ k+ ?3 I- e  \
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 w* J/ @$ p5 L
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
( Z* R) }3 _4 |5 |) ?6 Y0 gbegin P_induction arriving( _- z* A. T% x9 K# `
    clone 1 load to P_pick(A_induct)- T* b6 B# J' j1 p# `5 P
end最大的系9 ^" K6 z% m3 E+ f. r

% q! w* G1 H  u# l5 gbegin P_pick arriving' I  d# B; {* }6 e! W- j6 x7 d
    set A_i to procindex * 10 + 1
7 T. C( b# Y5 w4 P' L( D    move into Q_induct(procindex)
- r( f3 W  h, }8 m2 A1 ^$ U    move into pickaisle.induct(procindex)8 K6 T6 \. p, F0 V
    /*check the type of pickaisle.induct(i), for your last problem.*/
: z$ e) a4 u2 r) A; }3 F
- V/ W( N  \* _. q. M    while A_i<=30 do begin  u8 e9 h5 h# @3 q6 j/ X
        travel to pickaisle.con(A_i)0 s1 s, }$ T' m1 U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 b/ e: z6 C% m, w- q3 F/ g) v
        else wait for 10 sec
/ e+ T3 {. s* V+ [$ W9 V        if A_i=A_leave then send to die# W4 d0 b- P7 t2 w- H
        else inc A_i by 1$ C$ M! @% N6 q# V/ s  @4 B  R
    end" F/ ^- ]( @3 m( ]* n" F$ ]$ z
end6 p" L5 w. u/ Y- G3 m
$ E5 L6 J8 ~$ \! q9 H+ s
其中的procindex为整形,代表当前process的序号。. U4 f! k. E# W& a( [1 k; L
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-6-13 20:28 , Processed in 0.015783 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表