设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15518|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ v' D2 ~1 K7 K
: s/ X9 f% a- O8 _我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 c) Y8 ]" ?! U

! M$ Y: u9 g8 j" _! k" `begin P_read arriving/ {$ P. r+ `1 J8 j3 D" u
    while 1=1 do begin, m& i8 i. d6 {1 V% }
        read A_tote from "data.txt" with delimiter "\n"5 U& A# Z1 O5 Y7 [' W: H! `4 L
        read A_time from "data.txt" with delimiter "\n"
  u& A& ^, {! R8 ~9 A        read A_leave from "data.txt" with delimiter "\n". R/ D) N: @# U% `7 N% y& j: _% t. u6 C
        read A_picks from "data.txt" with delimiter "\n"
# j3 G! T1 M# K/ O% z        set load type to A_tote
! ]! ]; N; {, U! `+ l        if A_tote="tote 1" then set A_induct to 18 K2 O# C% }) u" y
        else if A_tote="tote 2" then set A_induct to 2
' N: N5 T' |# d' _3 m6 }            else set A_induct to 3   
6 ^8 I, c' H3 |: k        set A_i to 0
, O& ^* C& C* k+ y        clone 1 load to P_induction' K, L9 {/ j5 b+ R
        wait for A_time sec" r& |6 V3 c4 ^9 T& {4 a
    end8 z# b. I1 A$ }: f( q
end
7 @8 o, j0 y) ?' H7 ~1 i* \! H, w. }5 q: d, L- [4 k# ]% |
begin P_induction arriving; n0 B: h9 \# c
    if A_induct=1 then clone 1 load to P_pick1# I6 }  o/ l! d/ y/ ]; f
    else if A_induct=2 then clone 1 load to P_pick2
  h8 O. I! s- a' e) x+ }6 }" w        else clone 1 load to P_pick3
) G. d& x7 \- p% d, iend% s$ K  X" [6 a) O# W
0 L1 Q' A1 A4 L/ \7 Q
begin P_pick1 arriving
2 C+ q; m& V, t. v0 l5 v    set A_i to 1, u; _  a3 x  v( Q
    move into Q_induct1% {- d# ]9 |+ |, A
    move into pickaisle.induct1
2 r/ F' k4 l$ ^3 F9 b0 h    while A_i<=30 do begin( T- j; d" f( ^2 v( s, ]  \: b1 R
        travel to pickaisle.con(A_i)- V: w4 _; H$ @  z' M" \& ~0 D8 X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 t0 Q3 t- j: b& B- h
        else wait for 10 sec
' m! X1 M: @' F. x        if A_i=A_leave then send to die
+ O# H2 [6 F5 E5 J  \8 J* @        else inc A_i by 1
9 w: J3 v2 C7 s& O5 |/ `0 p; H    end+ i0 [' W6 }9 x) _( j
end( Z# O1 L7 ^6 L' W
9 w6 r, f7 z0 s& d7 C3 o' H4 ]
begin P_pick2 arriving2 _4 ~1 Z, U2 d: f, g! T; S
    set A_i to 11
) _6 n8 o1 \) T7 U    move into Q_induct2  g$ j) @+ T3 \
    move into pickaisle.induct27 v, d! v3 Z2 H2 X( p
    while A_i<=30 do begin7 u& _: F$ _& F: t* J  G0 O4 j
        travel to pickaisle.con(A_i)+ M" j3 p( j) L  j) U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 Z/ y8 v/ a, O( C1 p        else wait for 10 sec
+ X( B1 j1 _+ M0 w2 L2 d        if A_i=A_leave then send to die
2 Y& y/ [7 r  v0 `  q: L+ ]4 g$ H        else inc A_i by 1
% K8 P1 B# @; `5 Q0 t    end1 h( H4 I4 g& |  V
end7 z. V9 N$ X3 ?* I
( N: D8 j7 i- E) p' g
begin P_pick3 arriving
  x+ q7 W) B9 c1 b    set A_i to 21
' l1 H7 ]' e3 d# x" G9 E# D7 E    move into Q_induct3
( V, ~, ?  q+ ~    move into pickaisle.induct3
. y, @6 E: X# _0 Z2 l, @    while A_i<=30 do begin# }* G) _' `8 |/ v) Z  U. i
        travel to pickaisle.con(A_i)) ~$ [4 R% V0 M5 m5 _0 r1 [( H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 O6 \4 P0 `9 J5 }; e  h6 O, V        else wait for 10 sec
  M8 N0 S  X  D        if A_i=A_leave then send to die
2 T5 E2 `) m, A0 o- T8 ]        else inc A_i by 1. }2 Q; K6 p) U
    end
( y# Y8 E7 \; f% g3 \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是个什么东东?* j$ s3 U; M1 f( [
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?# I3 V9 Z2 i( o$ h2 ]: E
1 Z, J. T1 O' p) ~
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
5 X% r. ^9 g8 J. @0 Q  l1 [  X, X
+ Z/ m! ?, u0 [6 x另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. s7 T" u+ x- }, R8 E
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;1 W$ _: K2 k: p
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" V3 X. _, W/ |/ U3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:# ^( ^2 p0 ^8 J$ q
begin P_induction arriving  A) i3 }  C: D3 h. ]1 _) }
    clone 1 load to P_pick(A_induct)
3 {; y% a; g! N: bend最大的系
7 Q, ^" w) K1 Z1 a  ~4 q1 ?+ q0 e% v) U* t  d+ l
begin P_pick arriving0 z2 W/ U# E/ d! U  I8 A/ K/ e
    set A_i to procindex * 10 + 1
: \, s; ]! U9 T$ O    move into Q_induct(procindex), l5 J* Q( W3 `5 \- w+ ?  ]
    move into pickaisle.induct(procindex)% f* S8 ^9 y+ h+ @; E; i. Z- m
    /*check the type of pickaisle.induct(i), for your last problem.*/
- q" a2 ?* \0 V4 R' o4 s% q$ I( h" A4 @
    while A_i<=30 do begin
) J9 }8 X) h  p; X        travel to pickaisle.con(A_i)5 l0 Z. R# O1 A" @2 w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 r5 n. S9 ]6 A9 [
        else wait for 10 sec8 E) g  ~0 r9 V. [
        if A_i=A_leave then send to die+ z5 o9 W& C, [  Q
        else inc A_i by 1
" K! ]6 i; B/ l* h4 i. M' L( F    end
' ^" ?& G% T: A" `4 a; xend, @, S/ r' J' b3 O$ g+ X' e
# N9 W8 {9 `. Z0 b! r% r! j( h
其中的procindex为整形,代表当前process的序号。
+ x0 F2 i8 }* g8 m0 G/ z, c# Estation和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-17 00:42 , Processed in 0.016860 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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