设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15198|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 h4 W0 c! @7 R, E4 `( c9 [

( y+ ^3 J; w! J0 O5 ^: p, B我的问题是,在每个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中的数值,不知道会不会有什么不妥。0 p2 `; x0 W1 K  V6 k, @
0 ^$ ]2 F: k- V6 V
begin P_read arriving& O" T$ }2 W% G# s) u
    while 1=1 do begin
7 F! k& a- c  I4 b$ ]0 e6 o        read A_tote from "data.txt" with delimiter "\n"% S- `+ J8 e- C6 L6 D4 {
        read A_time from "data.txt" with delimiter "\n"
, g% f6 V# H7 I& U+ n9 V0 L- c) `        read A_leave from "data.txt" with delimiter "\n"
5 O1 Y) U( h9 ]. B* o& g        read A_picks from "data.txt" with delimiter "\n"
$ q% R- @0 X' l) d3 P        set load type to A_tote
  C8 p2 J  S. |- k) p2 Y        if A_tote="tote 1" then set A_induct to 11 W# _( a  s3 c
        else if A_tote="tote 2" then set A_induct to 2
) h* [& i: w$ e! A" {6 T            else set A_induct to 3   
% M- x* e! N( f        set A_i to 0
+ Z9 I5 O7 K; ^" o+ s) N0 L' ^* I' \        clone 1 load to P_induction/ V2 K( Q) [( V1 _1 v3 W, y
        wait for A_time sec
/ X; q" @  O2 h    end9 j- i$ |, I( c  m: W" I$ I
end
' V2 F  T1 X7 T- K# w$ {# N( ^. `. D: e
begin P_induction arriving2 U; |: T' Z$ @7 u
    if A_induct=1 then clone 1 load to P_pick1
' ?* z7 Y/ L% _/ y' C    else if A_induct=2 then clone 1 load to P_pick2) X# i) P- d( q
        else clone 1 load to P_pick37 b' W- ?( c: d4 E- M3 F6 W
end
) c' R2 t: [+ x. m: v
2 M$ f4 w% a$ ?: _# Jbegin P_pick1 arriving3 E' G7 H, S/ y& [! S3 b& g
    set A_i to 13 ]4 ?# V8 D$ h
    move into Q_induct1: i# I& ?3 d" W" Y% o- s! G
    move into pickaisle.induct1/ @- C. ^( P+ t3 b" V  i7 j
    while A_i<=30 do begin- k( l# v9 C8 [; Y
        travel to pickaisle.con(A_i)% B+ c) f+ Z" b4 s' E& e' q3 q7 L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! z9 m9 H6 {$ x+ C% m' @- S        else wait for 10 sec
7 @7 q8 C7 \5 N2 Z        if A_i=A_leave then send to die
9 B$ }$ {2 c* P1 u        else inc A_i by 1+ Z  y" o0 C# _$ N! J) B# |
    end
1 T% c& A/ W  Dend
" ]) J! n! `2 R. F: l: }
+ D; G: [! n% a  N2 `) t2 hbegin P_pick2 arriving
1 ^3 s) R2 l  e8 d6 f6 h+ ?+ O8 X    set A_i to 11
( t* W" v, Y0 c% e5 _    move into Q_induct2
+ h* n& U/ n* F$ Q% i- z+ e    move into pickaisle.induct23 @; l# l' A/ C+ L# {. K
    while A_i<=30 do begin
' _! s( l6 M  P  \" i/ i7 W% t; p        travel to pickaisle.con(A_i)
- p1 I  P3 [8 [6 H! M) w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 g$ T/ j  o! v0 h        else wait for 10 sec& O$ X/ Y; N& s  v, ?; S
        if A_i=A_leave then send to die
- ]/ r5 ?& _) J7 i        else inc A_i by 1+ m! ]. R) ]0 [, x# `! v
    end7 k: Q+ }& q4 `& l
end0 D3 k8 @5 v  E; R/ T- F4 c5 Y' F4 i
9 ]; P/ y  A+ W+ {4 _$ g
begin P_pick3 arriving
* V, m# F) n7 q: I/ G' E$ Q    set A_i to 21* s6 t6 a6 f' \& H7 m. f4 b; U
    move into Q_induct31 A; w4 ?( N, E) s, `! T) \0 h+ v
    move into pickaisle.induct38 c; Q+ Q# _% [* J( j4 _; P8 I
    while A_i<=30 do begin6 e) p4 D; F! Z) w# H$ ^
        travel to pickaisle.con(A_i)* H- ]5 v5 X% n/ V; x- t9 v9 a+ V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ r% l2 B, |5 `! `, ]0 `& ]( Z        else wait for 10 sec
8 J$ u! L' C# @! l5 R        if A_i=A_leave then send to die
2 g5 g% w+ r9 \  `( G* t: W        else inc A_i by 1" W2 h/ y3 G) l- w1 S/ _7 y
    end5 H- s3 B& n3 J  o; y& ?
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是个什么东东?
' x+ X5 Z0 V: Amove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?/ D: S$ J- \- \2 h: `
* N  E" L  v! ^1 W6 n- a
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。1 ?7 I: x6 r2 v/ `) ?
; g1 [% \7 u3 Q2 a: X  D
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* Y5 j4 K3 x9 p1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;) V" N, v, F6 N8 \2 n9 p+ G7 Z
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; T  X( _9 C% s* k
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
- l  }# h  [  L* Q5 ]9 F# j6 jbegin P_induction arriving
  Z6 b6 t. C  f# d$ v, _    clone 1 load to P_pick(A_induct)
# q. ]9 F  R9 h4 d3 k$ s( Q: T* \end最大的系
/ s* h: q8 M6 E* N' y* P$ L% z! F5 D- r4 m+ W
begin P_pick arriving6 l% U7 a8 J/ i4 k$ y
    set A_i to procindex * 10 + 1+ z/ X, V# c4 c5 T
    move into Q_induct(procindex)
7 d5 M. b  u) x& C8 W. R    move into pickaisle.induct(procindex)
; U8 C$ k% z2 ^! s8 ?& V6 ?    /*check the type of pickaisle.induct(i), for your last problem.*/# e; i4 h4 u" `/ s! ?- I: P

2 E2 @$ Y' g% E5 o1 \    while A_i<=30 do begin4 F! ]6 e" u+ z3 q
        travel to pickaisle.con(A_i)
1 F* |' @% e/ C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! C) P# W% B8 v! L) f
        else wait for 10 sec
' j' A4 y/ l8 o2 c! [. R6 P        if A_i=A_leave then send to die% @6 e. a% q, U- C# M0 {9 H% Z
        else inc A_i by 1
1 O% l2 o! q2 v  f; W. }1 g( t9 I    end
3 j% K6 L) _( l  Qend* g8 T9 @  f6 j, n1 O' i) \

5 _4 \& P$ h1 i2 d2 _: P/ f其中的procindex为整形,代表当前process的序号。/ u# C0 I: Y8 g$ R
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-22 12:46 , Processed in 0.015849 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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