设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15264|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 L! {6 I$ V) ]6 G1 F5 g7 P9 m* a! o
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' L9 j+ |0 G) m, g% A' r- ]( e  s
. Z) k) Q! J; F
begin P_read arriving4 W) c& Y, x+ D& Z; H# b: ~
    while 1=1 do begin3 |* |8 p  q7 r# o/ d3 Z. f
        read A_tote from "data.txt" with delimiter "\n"
! p( M; w8 q* C: I5 B) ^2 Q, ^, Z        read A_time from "data.txt" with delimiter "\n"9 O( X7 A  |: D6 T/ Q' C3 h3 r
        read A_leave from "data.txt" with delimiter "\n"& g5 e5 b" s! ~0 \* R* U# v
        read A_picks from "data.txt" with delimiter "\n"$ r/ T- G4 X; f5 [3 e
        set load type to A_tote" s  }" q& w+ f
        if A_tote="tote 1" then set A_induct to 1
- j% e, V8 R, Z$ o" @2 c        else if A_tote="tote 2" then set A_induct to 25 u% @2 V/ K9 }: Y
            else set A_induct to 3    2 k" Q% l/ B- l2 O) v& ?5 r; }
        set A_i to 0
3 N$ Y) R" C* T        clone 1 load to P_induction
! K- R( p( c4 C% U7 V& f        wait for A_time sec2 X( P8 R- i9 ~( O/ h3 h9 A3 b7 b
    end/ V, l' |1 I# W1 f  V
end
2 U) c4 t- P  r) I- l- ?8 `
% g( o  O! @2 P6 y4 C. F. tbegin P_induction arriving( S9 v' `0 p; h2 P4 n3 Y; F
    if A_induct=1 then clone 1 load to P_pick12 k$ t/ M7 l% s" J7 x2 M
    else if A_induct=2 then clone 1 load to P_pick2+ S3 B9 }- ?3 Q- H& Z
        else clone 1 load to P_pick3
% {9 u+ z* h+ ^5 K( y5 Dend9 f; N! f* g* N; j

- f: o" ]  t8 g; M/ y* F! ~begin P_pick1 arriving
; v% w2 R4 {1 K' \    set A_i to 1
" Z/ }* ]& X, ?* w. E% h" B    move into Q_induct1/ ]% b) C' ?# d% ]; ]: ~( M2 }$ t
    move into pickaisle.induct1" M$ J1 F: d1 V! B6 G
    while A_i<=30 do begin
8 d% L& @6 C; ~7 F/ N        travel to pickaisle.con(A_i)
* {0 ^; |6 G/ N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. g( z7 K4 q  u+ X( t8 L        else wait for 10 sec9 K+ B1 _4 H; y7 J9 D  O
        if A_i=A_leave then send to die& x2 T+ M/ v  {% O0 L
        else inc A_i by 1
' T3 L  p+ S$ y- e" n% H7 Q  O9 B    end% X+ U( U0 h9 z: l" y
end1 `+ I4 Q! A2 e1 |( j
6 p, A2 E* d5 k
begin P_pick2 arriving; o% ^, L  ]) d! F% J" q- \$ q; K5 a5 U
    set A_i to 119 n* D1 l% t- x- D" k; g
    move into Q_induct2) V$ b6 m1 l" f! C5 S
    move into pickaisle.induct2: O8 q0 Z1 C9 s" _! W
    while A_i<=30 do begin
: }# E: X8 A+ X  j' E& X        travel to pickaisle.con(A_i)
3 q+ T. N; V; I0 l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 e% a7 y$ g8 k' M  k
        else wait for 10 sec
; g! t& m9 T+ V* o: @! I! x) v        if A_i=A_leave then send to die
9 T  m  P3 _* r        else inc A_i by 19 \6 s  z! ?# I
    end
- F+ z. R, A2 h+ b, s2 A- B0 Iend8 H, B6 u( u3 H+ T

2 S; x% |. d( Lbegin P_pick3 arriving
4 H# O+ V4 n1 e* i0 {5 I; _" g, w9 X    set A_i to 218 M7 T6 a) w' f  ]' J7 v
    move into Q_induct3: C( Y# s6 Y+ D$ y+ x7 d& Z2 M1 I
    move into pickaisle.induct3/ s2 k: e  K' q
    while A_i<=30 do begin& S9 p' \8 W( l4 o2 i9 N
        travel to pickaisle.con(A_i)" y/ K! s" S" c& k, {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 ~9 v0 @  \6 F2 H& B( V+ ]        else wait for 10 sec
: A6 l3 w- Z% {: [+ {; C        if A_i=A_leave then send to die
+ p' e- W. w1 ~" f: c( m        else inc A_i by 1
! q/ Y3 a# X; d: m, M3 J    end
. ~6 {/ S$ k. X9 Aend

最佳答案

查看完整内容

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是个什么东东?& l" s9 S, A$ l2 W) Y& Z9 }
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
% w" f! m* a  W" q3 ?$ G( _9 o% G5 x5 c$ |4 n# N) c- Q/ m
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 C3 Q! O0 J7 o2 B9 o3 V' Q; _8 K; B' b2 o1 K' {; H
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:3 K, ^8 O! Y- T, R$ F- ^9 H
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;1 c# b; C0 }6 G8 G2 |
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
& t) |7 Y* ]8 R5 k' N8 n" S8 X6 \3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 K7 X% B$ p+ ], }3 n
begin P_induction arriving
' P6 ]/ e' C7 K9 |    clone 1 load to P_pick(A_induct)) e* E! w* `  s
end最大的系2 o: t. F1 l9 S% T0 y4 E5 |
$ l' P$ R2 h* I4 w( g& G5 i2 i
begin P_pick arriving6 \& }# v# V; ]1 z3 L
    set A_i to procindex * 10 + 18 B/ \* y9 _6 h/ R
    move into Q_induct(procindex)( |) x' [4 O9 `3 b, ^5 N
    move into pickaisle.induct(procindex)
8 i& K5 X7 {6 ?* P: ^    /*check the type of pickaisle.induct(i), for your last problem.*/
1 v3 X$ s% l- L- [0 z& G7 @* i3 s
! m/ q0 D0 k# s    while A_i<=30 do begin% I# t! }5 L$ c. v7 h' j( ~8 [
        travel to pickaisle.con(A_i)
7 f3 D& W- }4 W0 l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" _3 ?9 A2 b0 L* T3 Y        else wait for 10 sec
, S; u, L. P9 A. i        if A_i=A_leave then send to die+ Z% m7 d9 |; G. F0 _1 c( D5 t
        else inc A_i by 1
. P8 T# m6 ]( d4 u5 ?' o8 w    end
% J# q& X2 u; t2 v( ^end, b; J4 m9 [4 L. d7 d
( |, U7 K  W' |/ u. R4 ~
其中的procindex为整形,代表当前process的序号。' O  U; [' D2 x" {0 z3 z
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-8-28 12:30 , Processed in 0.023336 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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