设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15371|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# Q, i# X! p8 a9 E; {" ]; c

0 z$ O+ \" N6 ~% F8 b2 @; f我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 w" K3 C7 }! i. E& \: t. [- b: C9 y
begin P_read arriving
+ F: f1 @( j- ^/ k; K& F    while 1=1 do begin  S. u/ N, ^( v+ p7 y" \4 Q* x1 ]5 k
        read A_tote from "data.txt" with delimiter "\n"
. e0 @" X, O4 S% Q. {( e+ s        read A_time from "data.txt" with delimiter "\n"
. M/ D! u3 y8 L7 @0 f4 b        read A_leave from "data.txt" with delimiter "\n"
% M) `  K; h  z' g4 Q7 J& J, _+ p" q8 }; c        read A_picks from "data.txt" with delimiter "\n"" D- ~, @9 Y- f
        set load type to A_tote& F* @. A6 f0 r, m
        if A_tote="tote 1" then set A_induct to 1
) S7 H% M. y" a* _3 U8 d        else if A_tote="tote 2" then set A_induct to 2
: k3 c1 Y$ D8 h            else set A_induct to 3   
; b# U, s  y3 d1 @        set A_i to 0
3 c+ S3 T1 j% B9 m% L        clone 1 load to P_induction
- ~$ R4 i. b" R7 t3 H) i        wait for A_time sec
% U3 a- @) `3 l& R# H    end* s% E; {9 [" B2 r" \: {' y
end
8 E  a5 S" d" W1 |% l& C
' U4 J; ~6 N1 [  d0 ]# T0 ebegin P_induction arriving' q0 |( D7 w0 Y: Q) P: v) G4 k
    if A_induct=1 then clone 1 load to P_pick1' L. z0 q8 o% m2 u
    else if A_induct=2 then clone 1 load to P_pick2
% Z3 ^+ C7 t3 e2 R        else clone 1 load to P_pick3
% }( U  x/ Q) K7 ]+ ^end
: s2 G4 k) u( ~: @/ d- l- L' e4 g% r7 o# a* e- x
begin P_pick1 arriving5 |/ E" c0 W/ a, S0 `1 \* w+ [
    set A_i to 1/ X1 e4 }/ Q; m( {* v. I
    move into Q_induct1
. T$ I2 _0 X! ~7 G& u    move into pickaisle.induct1, E+ G8 Z8 m6 X3 i
    while A_i<=30 do begin8 o5 l! y! C0 H
        travel to pickaisle.con(A_i)
: l  U1 z7 x7 D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# [: L: B6 Y% y7 y- g6 ]% n        else wait for 10 sec
- p" N$ c9 ?2 x4 Y3 b8 u: e        if A_i=A_leave then send to die5 ^  E  u& B1 P4 |5 Q7 L
        else inc A_i by 18 z$ g0 A- a2 a3 K
    end5 w7 P" a; g& V/ `. L( ?
end# J" H1 p& |. }- }
3 C6 }8 A6 s( p1 x
begin P_pick2 arriving
" F% v: q: a/ n* `* m: t" x2 E    set A_i to 114 h( l, \- Z! w: k0 @5 |8 l8 x
    move into Q_induct2& a: \3 q8 m) Q# |! ?% r" _
    move into pickaisle.induct29 o, @" U/ ^$ H
    while A_i<=30 do begin
9 V+ L5 a/ z9 D- d1 S0 n* R        travel to pickaisle.con(A_i)
3 \$ R# i( F6 d5 ^8 r* y( E6 M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, |" g0 j4 Q2 z) R# [        else wait for 10 sec, T# H2 A' h4 V' H6 _
        if A_i=A_leave then send to die0 x, {" I. M* {& r0 ~5 O
        else inc A_i by 1/ {/ @* E5 [8 c; h% g5 n
    end& ~+ t- I1 Y  N7 {8 g6 T  L- o
end9 L2 b( }  ^4 v; z2 l5 H

' V6 n! A  U! cbegin P_pick3 arriving
2 `' |9 @1 Q. G7 O3 c    set A_i to 210 H) m/ `) T* A+ {# b
    move into Q_induct36 n) g; v% i9 F' e6 k1 j
    move into pickaisle.induct3" {# N" Z8 w  x2 `; o, M- [  T
    while A_i<=30 do begin
9 B  B# J0 [5 l        travel to pickaisle.con(A_i)
9 T9 H) i, c, @0 h' q* Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' W  `' M; t+ }  x8 L2 `        else wait for 10 sec1 h/ y# }' j" F% g! ?! ~' s
        if A_i=A_leave then send to die- V( v3 ^9 f. y8 s9 f
        else inc A_i by 1( m5 ?8 H# L  J# i- q& S
    end/ }% N" G5 q# V; S" s
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是个什么东东?
  Z4 D& u  f/ ?" i6 i! d/ @1 `move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 {- H5 T5 L8 A# [6 y  I8 g& y+ B, k6 m5 G) X# S* A
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ g/ t- j/ g% T% q1 O
& b) T: G4 Y* Y: Z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. s! W4 t6 W7 z- h
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
; b% W, z4 J9 B9 ~& b0 T: ?- g2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" h2 K/ P5 R, }, `' p) G2 H
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
- n% r5 ~! L+ I* abegin P_induction arriving# t  o! E3 N9 v& Q
    clone 1 load to P_pick(A_induct)# [! K6 F" x1 j
end最大的系
# |- `5 M( y; l
: j, w- P  m3 Sbegin P_pick arriving
6 a9 e. ~: F& @7 E  Z; u1 R    set A_i to procindex * 10 + 1
3 z* B' _2 x- s$ X$ x! P7 t1 V    move into Q_induct(procindex)
/ m. p5 w5 B6 d+ A2 `5 y: Y    move into pickaisle.induct(procindex)
! P$ k* n# b2 r! ?- ~7 \! e    /*check the type of pickaisle.induct(i), for your last problem.*/
# V1 \4 O: \! ^* J! K; i+ C% R8 H% |* X  M& j
    while A_i<=30 do begin
9 u) S( D7 j, T# L$ c        travel to pickaisle.con(A_i)
) C- v  C4 s  Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ a+ C% d6 i8 t4 R        else wait for 10 sec
8 ^9 g1 s0 i  T0 H        if A_i=A_leave then send to die5 D( V' |  @, n$ N+ K4 t
        else inc A_i by 17 R$ _; {( f( E2 _  `1 E9 \( q, O
    end" u: H& N" c' m  A
end* O3 R$ C4 m( ^- f  f
" |' U! G, I! @$ d) u. W( e
其中的procindex为整形,代表当前process的序号。# I5 j- |) w- o' J/ K, j
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-9-6 11:22 , Processed in 0.017229 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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